Kimi K2.5 API

Img2Vid 在公开 chat 模型 API 中使用 moonshot/kimi-k2.5 暴露 Kimi K2.5。

模型标识

字段
Img2Vid 模型 key moonshot/kimi-k2.5
运行时模型 id kimi-k2.5
Provider MoonShot
公开能力 Reasoning、图片附件、工具调用

价格

单位 Credits
Input 每 1,000,000 tokens 6 credits
Output 每 1,000,000 tokens 30 credits
Cached input 每 1,000,000 tokens 3 credits

模型参数

moonshot/kimi-k2.5 当前没有配置额外公开模型参数。需要请求配置好的 thinking mode 时,传递 reasoning: true

OpenAI 兼容示例

curl https://img2vid.net/api/v1/chat/completions \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonshot/kimi-k2.5",
    "messages": [
      {
        "role": "system",
        "content": "You are a precise research and coding assistant."
      },
      {
        "role": "user",
        "content": "Analyze this product requirement and identify the implementation risks."
      }
    ],
    "reasoning": true,
    "max_completion_tokens": 800
  }'

Anthropic Messages 兼容示例

curl https://img2vid.net/api/v1/messages \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonshot/kimi-k2.5",
    "system": "You are a precise research and coding assistant.",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Analyze this product requirement and identify the implementation risks."
          }
        ]
      }
    ],
    "thinking": true,
    "max_tokens": 800
  }'

Gemini 兼容示例

curl https://img2vid.net/api/v1beta/models/moonshot/kimi-k2.5:generateContent \
  -H "Authorization: Bearer $BUBLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "systemInstruction": {
      "parts": [
        {
          "text": "You are a precise research and coding assistant."
        }
      ]
    },
    "contents": [
      {
        "role": "user",
        "parts": [
          {
            "text": "Analyze this product requirement and identify the implementation risks."
          }
        ]
      }
    ],
    "reasoning": true,
    "generationConfig": {
      "maxOutputTokens": 800
    }
  }'

Gemini 兼容流式输出使用 /api/v1beta/models/moonshot/kimi-k2.5:streamGenerateContent

SDK 示例

下面的示例使用本页的 Img2Vid chat 模型 key,并通过 OpenAI 兼容 Chat Completions 调用。片段假设你已经按快速开始初始化了 SDK client,并引入了对应语言需要的 SDK 类型。Anthropic Messages 和 Gemini 兼容调用使用同一模型 key;Gemini 流式输出请使用 SDK 的 streamGenerateContent / stream_generate_content 方法。

JavaScript / TypeScript

const completion = await buble.chat.completions.create({
  model: 'moonshot/kimi-k2.5',
  messages: [
    {
      role: 'system',
      content: 'You are a precise research and coding assistant.',
    },
    {
      role: 'user',
      content:
        'Analyze this product requirement and identify the implementation risks.',
    },
  ],
  reasoning: true,
  max_completion_tokens: 800,
});

console.log(completion.choices?.[0]?.message?.content);

Python

completion = client.chat.completions.create(
    model="moonshot/kimi-k2.5",
    messages=[
        {"role": "system", "content": "You are a precise research and coding assistant."},
        {"role": "user", "content": "Analyze this product requirement and identify the implementation risks."},
    ],
    reasoning=True,
    max_completion_tokens=800,
)

print(completion["choices"][0]["message"]["content"])

Go

completion, err := client.Chat.Completions.Create(ctx, buble.ChatRequest{
	"model": "moonshot/kimi-k2.5",
	"messages": []any{
		map[string]any{"role": "system", "content": "You are a precise research and coding assistant."},
		map[string]any{"role": "user", "content": "Analyze this product requirement and identify the implementation risks."},
	},
	"reasoning":             true,
	"max_completion_tokens": 800,
})
if err != nil {
	return err
}
fmt.Println(completion)

Rust

let completion = client.chat().completions().create(serde_json::json!({
    "model": "moonshot/kimi-k2.5",
    "messages": [
        { "role": "system", "content": "You are a precise research and coding assistant." },
        { "role": "user", "content": "Analyze this product requirement and identify the implementation risks." }
    ],
    "reasoning": true,
    "max_completion_tokens": 800
})).await?;

Swift

let completion = try await client.chat.completions.create([
    "model": "moonshot/kimi-k2.5",
    "messages": [
        ["role": "system", "content": "You are a precise research and coding assistant."],
        ["role": "user", "content": "Analyze this product requirement and identify the implementation risks."]
    ],
    "reasoning": true,
    "max_completion_tokens": 800
])

Dart / Flutter

final completion = await client.chat.completions.create({
  'model': 'moonshot/kimi-k2.5',
  'messages': [
    {'role': 'system', 'content': 'You are a precise research and coding assistant.'},
    {'role': 'user', 'content': 'Analyze this product requirement and identify the implementation risks.'},
  ],
  'reasoning': true,
  'max_completion_tokens': 800,
});

Elixir

{:ok, completion} =
  Buble.Chat.Completions.create(client, %{
    model: "moonshot/kimi-k2.5",
    messages: [
      %{role: "system", content: "You are a precise research and coding assistant."},
      %{role: "user", content: "Analyze this product requirement and identify the implementation risks."}
    ],
    reasoning: true,
    max_completion_tokens: 800
  })

Java

var completion = client.chat().completions().create(Map.of(
        "model", "moonshot/kimi-k2.5",
        "messages", List.of(
                Map.of("role", "system", "content", "You are a precise research and coding assistant."),
                Map.of("role", "user", "content", "Analyze this product requirement and identify the implementation risks.")),
        "reasoning", true,
        "max_completion_tokens", 800));

.NET

var completion = await client.Chat.Completions.CreateAsync(new Dictionary<string, object?>
{
    ["model"] = "moonshot/kimi-k2.5",
    ["messages"] = new[]
    {
        new Dictionary<string, object?> { ["role"] = "system", ["content"] = "You are a precise research and coding assistant." },
        new Dictionary<string, object?> { ["role"] = "user", ["content"] = "Analyze this product requirement and identify the implementation risks." }
    },
    ["reasoning"] = true,
    ["max_completion_tokens"] = 800
});

PHP

$completion = $client->chat()->completions()->create([
    'model' => 'moonshot/kimi-k2.5',
    'messages' => [
        ['role' => 'system', 'content' => 'You are a precise research and coding assistant.'],
        ['role' => 'user', 'content' => 'Analyze this product requirement and identify the implementation risks.'],
    ],
    'reasoning' => true,
    'max_completion_tokens' => 800,
]);

Ruby

completion = client.chat.completions.create(
  model: "moonshot/kimi-k2.5",
  messages: [
    { role: "system", content: "You are a precise research and coding assistant." },
    { role: "user", content: "Analyze this product requirement and identify the implementation risks." }
  ],
  reasoning: true,
  max_completion_tokens: 800
)