编程

kimi

试用

Call the Kimi API (kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-k2.5) through RunAPI using OpenAI-compatible Chat Completions. Use for Kimi text chat, streaming, or an existing compatibility client that needs the conditional reference.

它能做什么

Call the Kimi API (kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-k2.5) through RunAPI using OpenAI-compatible Chat Completions. Use for Kimi text chat, streaming, or an existing compatibility client that needs the conditional reference.

技能文档

Kimi on RunAPI

Use OpenAI-compatible Chat Completions at https://runapi.ai/v1 as the primary protocol.

Primary protocol recipe

Authenticate

Set OPENAI_API_KEY to a RunAPI API key and OPENAI_BASE_URL to https://runapi.ai/v1.

Send request

from openai import OpenAI
client = OpenAI(api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai/v1")
response = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Explain this finding."}],
)
print(response.choices[0].message.content)
print(response.usage)

For long output, set stream=True and stream_options={"include_usage": True}; consume through [DONE].

Verify result

Require final assistant content, finish_reason, and authoritative usage. Use the returned final answer rather than raw reasoning content.

Stop boundaries

Correct a rejected shape once using the structured error. Retry transport once only before any response or Usage and when replay is safe. Record a terminal error and stop without changing model or protocol. For kimi-k3 and kimi-k2.7-code, start with text history and final answers; add tools, multimodal input, reasoning controls, cache controls, or continuation only when the current RunAPI contract explicitly verifies the exact shape.

Compatibility protocols

Load compatibility protocols only when an existing client requires Anthropic Messages or Gemini contents.

Supported models

Model IDUse when
kimi-k3Current flagship basic text requests
kimi-k2.7-codeDedicated coding requests
kimi-k2.6Recent Kimi K2 chat workloads
kimi-k2.5Kimi K2.5 compatibility

References

相关技能

Moonshot AI thinking model with text, image, and video understanding. Suited to complex analysis, coding, and writing that needs long reasoning chains.

Call the Qwen text API (qwen3-next-80b-a3b-instruct) through RunAPI using the official OpenAI SDK or compatible clients. Use when the user asks for Qwen text...

1 次安装

Call Gemini 2.5 and 3 series models through RunAPI using Gemini contents clients. Use for Gemini chat, streaming, multimodal input, grounding, structured output, reasoning, or an existing compatibility client that needs the conditional reference.

13 次安装

Call the MiniMax text API (MiniMax-M3 through MiniMax-M2) through RunAPI using OpenAI-compatible Chat Completions. Use for MiniMax text chat, streaming, or an existing compatibility client that needs the conditional reference.

2 次安装

Kimi K3子Agent架构 - 两阶段批量调度、生命周期管理、限流策略。借鉴MoonshotAI/kimi-code源码,提供Python实现

1 次安装

Call GPT generation and OpenAI text embedding models through RunAPI using OpenAI-compatible clients. Use for chat, Responses, embeddings, streaming, tools, vision, or an existing compatibility client that needs the conditional reference.

12 次安装