# Kimi

## What it is

**Kimi** is Moonshot AI's line of large-context (up to 1M tokens) multimodal AI models, with an OpenAI-compatible API. The integration connects with a personal API key and lets a bot flow chat with the model, analyze images, use the model's built-in web search, and extract text from uploaded files — all directly from the flow.

## Requirements

- An account at [platform.kimi.ai](https://platform.kimi.ai).
- An API key from **Console → API keys**.

## How to connect

1. Sign in at [platform.kimi.ai](https://platform.kimi.ai) and open [Console → API keys](https://platform.kimi.ai/console/api-keys).
2. Create a key and copy it.
3. In the constructor, open **Integrations** → find the **Kimi** card → **Connect**.
4. Paste the key into the connection field and save.
5. Verify the connection with **Test connection** — it shows the current account balance.

## Available operations

| Operation | What it does |
|---|---|
| Send message | Chat with the model: system prompt, conversation history, JSON mode, streaming output |
| Analyze image | Answers a question about an image (URL or a Telegram file_id) |
| React to message | The model picks one emoji reaction from a given list |
| List models | Returns the available models and their parameters |
| Web search | Chat that automatically uses the model's built-in web search when needed to answer |
| Extract text from file | Uploads a file (PDF, DOCX, TXT, etc.) and returns its extracted text |

## Limits

- Every operation calls Kimi's chat endpoint (`/v1/chat/completions`) — tokens are billed per your account's plan.
- Kimi's API has no image generation, embeddings, or moderation endpoints — there are no corresponding operations here.
- "Web search" may exchange a few requests with the model within a single operation call (until the model gives a final answer) — this adds a bit of latency and token usage compared to a plain message.

## Notes

> The "Extract text from file" operation doesn't answer questions by itself — it only pulls the file's text into a variable. To ask a question about a document, pass `{{result.text}}` into the "Send message" operation's system prompt as the next step of the flow — this is the approach Kimi's own docs recommend.

> In "Web search", the model itself decides whether search is needed to answer — if the question doesn't need fresh information from the internet, no search runs and `{{result.used_search}}` stays empty.
