Kimi models can look things up on the internet before they answer. In the API, that costs a small search fee plus the tokens for the results the model reads, and the results are often the bigger cost. This page shows what a searched answer really costs, compares the old built-in search with the newer Search API, and explains how to switch.
An illustration: the same search, billed two ways.
$web_search tool is retiring. Moonshot expects to deprecate it on 20 October 2026. We are an independent guide, not Moonshot AI. Prices are from Moonshot's pricing pages and exclude tax. Per-call details for the newer tools: Web Search API pricing.From Moonshot's tool pricing page and its "Use Web Search" guide, read on 8 October 2026. The countdown uses your device's date.
It replies with a tool call instead of an answer. Your app sends the call back unchanged.
$0.005 search feeThe results are added to the conversation. The number of tokens is shown in the tool call's arguments.
Results billed as inputIt reads the results and writes the reply, billed at the model's normal prices.
Normal input + outputMoonshot's formula: total_tokens = prompt_tokens + search_tokens + completion_tokens. If your app stops after step 1, only the $0.005 fee is charged.
Moonshot's guide shows one real $web_search answer: 13,212 prompt tokens (13,046 of them search results) and 295 output tokens. Here is what that costs on each model.
| Model | Tokens | With $0.005 fee | Per 1,000 answers |
|---|---|---|---|
| kimi-k3 | $0.0441 | $0.0491 | $49.06 |
| kimi-k2.7-code | $0.0137 | $0.0187 | $18.73 |
| kimi-k2.7-code-highspeed | $0.0275 | $0.0325 | $32.46 |
| kimi-k2.6 | $0.0137 | $0.0187 | $18.73 |
On a small screen, swipe the table sideways to see every column.
Our arithmetic from Moonshot's example and list prices. On Kimi K3 the output would also include its thinking, so real output is often larger.
Compare the monthly cost of $web_search with calling the Search API yourself and sending only the short results.
Both include the question (200 tokens) and the answer (300 output tokens) at list prices, over 30 days. The old default of 13,000 result tokens follows Moonshot's example. The new default of 1,500 is our assumption for five titles, links and snippets; measure your own. Moonshot's guide says Pro's ranked passages usually cut tokens by about ten times compared with full pages.
Moonshot also mentions an official web-search tool as a replacement. Its K3 quickstart says that tool is being updated and is not recommended for production yet, and we found no separate price for it.
Search your code for $web_search and builtin_function.
Replace it with a normal function tool, with a name, description and a query parameter.
When the model calls your tool, search with /v1/tools/search and send back short results.
Check answers and token use before 20 October.
"tools": [
{"type": "builtin_function", "function": {"name": "$web_search"}}
]import json, os, requests
from openai import OpenAI
KEY = os.environ["MOONSHOT_API_KEY"]
client = OpenAI(api_key=KEY, base_url="https://api.moonshot.ai/v1")
tools = [{"type": "function", "function": {
"name": "web_search",
"description": "Search the web for current information",
"parameters": {"type": "object",
"properties": {"query": {"type": "string"}},
"required": ["query"]}}}]
def web_search(query):
r = requests.post("https://api.moonshot.ai/v1/tools/search",
headers={"Authorization": f"Bearer {KEY}"},
json={"text_query": query, "limit": 5}, timeout=30)
r.raise_for_status()
# keep only short fields to save tokens
return [{"title": x["title"], "url": x["url"], "snippet": x["snippet"]}
for x in r.json().get("search_results", [])]
messages = [{"role": "user", "content": "What is new with Kimi K3?"}]
while True:
resp = client.chat.completions.create(
model="kimi-k2.6", messages=messages, tools=tools)
choice = resp.choices[0]
if choice.finish_reason != "tool_calls":
print(choice.message.content)
break
messages.append(choice.message)
for tc in choice.message.tool_calls:
q = json.loads(tc.function.arguments)["query"]
messages.append({"role": "tool", "tool_call_id": tc.id,
"name": "web_search",
"content": json.dumps(web_search(q))})The "after" example is a short sketch written for this guide from Moonshot's documented fields. We have not run it against the live API; add error handling and limits before production. Setup: Kimi API setup.
$web_search: no search fee when the model answers without searching.From Moonshot's tool pricing page. Model tokens are always charged at normal prices: Kimi API pricing.