Skip to main content
Kimi Open Platform offers a set of official tools that you can freely integrate into your own applications (official tools are currently free for a limited time; when the tool load reaches capacity limits, temporary rate limiting measures may be applied). This page lists the available official tools and shows how to call and execute them through the Kimi API.
When using official tools such as web search with kimi-k3, use the Formula API official tools channel described on this page (OpenAI protocol, standard function tool); the example below has been verified with kimi-k3.

Choose an official tool to use

The following table lists the currently available official tools:

Full example: call the web_search official tool

The following Python example uses the web-search official tool to show the full call chain (it only depends on requests). You can also interactively experience the capabilities of Kimi models and tools in the Kimi Development Workbench. Using official tools through the Formula API follows the standard function tool flow of the OpenAI protocol, in 4 steps:
  1. GET /v1/formulas/{uri}/tools — fetch the tool declarations (uri such as moonshot/web-search:latest);
  2. POST /v1/chat/completions — send the tool declarations; the model returns standard function-type tool_calls;
  3. POST /v1/formulas/{uri}/fibers — execute exactly what tool_calls specifies (name + arguments passed through verbatim; this step produces the tool_call billing);
  4. POST /v1/chat/completions — send the assistant message (with tool_calls) and the role: "tool" results to get the final answer.
The example defaults to moonshot/web-search:latest; set FORMULA_URI to another official tool’s formula URI to try it: moonshot/convert:latest, moonshot/web-search:latest, moonshot/rethink:latest, moonshot/random-choice:latest, moonshot/mew:latest, moonshot/memory:latest, moonshot/excel:latest, moonshot/date:latest, moonshot/base64:latest, moonshot/fetch:latest, moonshot/quickjs:latest, moonshot/code-runner:latest
The examples on this page use the latest model kimi-k3 by default. K3 configures reasoning effort with the top-level reasoning_effort request field (supports "low" / "high" / "max", default "max"). To use another model such as kimi-k2.6 or kimi-k2.5, just replace the model field — parameter configurations differ across models. See the Model Parameter Reference.
You only need to install requests and set the MOONSHOT_API_KEY environment variable before running.

Understand the Formula concept

Before calling official tools, you need to understand Formula: it is a lightweight script engine collection that transforms Python scripts into “instant computing power that can be triggered by AI with one click” — developers only need to focus on writing code, while the platform handles startup, scheduling, isolation, billing, and recycling. Formulas are called through semantic URIs (such as moonshot/web-search:latest). Each formula contains a declaration (telling the AI what it can do) and an implementation (Python code), and the platform automatically handles all underlying details (startup, isolation, recycling, etc.), making tools easy to share and reuse in the community. You can experience and debug these tools in Kimi Playground, or call them through the API in your applications.

Call a Formula directly to run a tool

A formula URI generally consists of 3 parts, for example moonshot/web-search:latest: web-search is its name; the namespace currently only supports moonshot; and latest is the default tag. For example, to call web search, you can send an HTTP request like this:
web-search was set as protected when created, so its result appears in the context.encrypted_output field, in a format similar to ----MOONSHOT ENCRYPTED BEGIN----... ----MOONSHOT ENCRYPTED END----; this content can be passed directly into the tool call.

Integrate official tools with Chat Completions

As shown in Is 3214567 a prime number? An example of Tool Calls, when using official tools with Chat Completions, there are several key points you need to align between the Formula API and the model.

Fetch the tool definition and append it to the tools field

Given a formula URI (for example moonshot/web-search:latest), append it directly to the URL to request the tool declarations:
Sample output:
Take the tools field from the response (always an array of dicts) and append it to your request’s tools list — the platform guarantees this list is API-compatible. Note that:
  • If type=function, you need to ensure function.name is unique within a single API request, otherwise the chat completion request will be considered invalid and immediately returned with a 400 error (invalid_request_error, with a message like function name get_weather is duplicated);
  • If you use multiple formulas at the same time, you need to maintain your own function.name -> formula_uri mapping for future reference.

Handle the tool call returned by the model

If the chat completion returns finish_reason=tool_calls, the model has triggered a tool call, and the response looks like this:
From choices[0].message.tool_calls[0].function.name you can tell that web_search needs to be called, and the formula_uri corresponding to web_search is moonshot/web-search:latest. Copy choices[0].message.tool_calls[0].function from the response in full as the body, and send a request to ${MOONSHOT_BASE_URL}/formulas/${FORMULA_URI}/fibers. Note that although the function.arguments output by the model is valid JSON in content, it is still an encoded string in format — you don’t need to escape it; just use it directly as the body of the call.

Handle the Fiber result and continue the conversation

A Fiber is a “process snapshot” of a specific execution, containing logs, Tracing, and resource usage, which is convenient for debugging and auditing. The status of the POST result may be succeeded or various types of errors; when it succeeds, the result looks like this:
Search tools may return encrypted_output, while in general the result is output — this output is your input for the next round. When continuing the request, arrange the messages as follows:
The model can then continue with further reasoning.

Notes

  • The model may return more than one tool_calls; you must return results for all tool_calls for the model to continue, otherwise the request will be considered invalid and rejected;
  • If the assistant message has tool_calls, the next messages must be exactly the same role=tool messages as the tool_calls, and tool_call_id must be aligned one-to-one with the previous tool_calls.id:
    • If there are multiple tool_calls, the order is not sensitive;
    • The ids of the tool_calls output by the model are always unique, and the ids in the role=tool messages must also be aligned with them;
    • The uniqueness requirement is only local to the tool_calls-response in this round, not for the entire conversation or globally.