Created
July 17, 2026 20:13
-
-
Save kamilio/c1280e6e7bd8c590c789b4cab6e00c94 to your computer and use it in GitHub Desktop.
Repro: Vercel AI Gateway rejects Kimi K3 documented builtin_function $web_search tool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // npm install openai | |
| import OpenAI from "openai"; | |
| const client = new OpenAI({ | |
| apiKey: process.env.VERCEL_API_KEY, | |
| baseURL: "https://ai-gateway.vercel.sh/v1", | |
| }); | |
| const completion = await client.chat.completions.create({ | |
| model: "moonshotai/kimi-k3", | |
| messages: [ | |
| { role: "system", content: "You are Kimi." }, | |
| { | |
| role: "user", | |
| content: | |
| "Please search for Moonshot AI Context Caching technology and tell me what it is.", | |
| }, | |
| ], | |
| tools: [ | |
| { | |
| type: "builtin_function", | |
| function: { name: "$web_search" }, | |
| }, | |
| ], | |
| }); | |
| console.log(JSON.stringify(completion, null, 2)); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result
Kimi documentation: https://platform.kimi.ai/docs/guide/use-web-search