The examples use
deepseek/deepseek-v4.1-flash. Any OpenRouter model that supports tool calling works. Set OPENROUTER_API_KEY first.
Python
TOOLS holds OpenAI-format definitions for keenable_search and keenable_fetch. run_tool_call runs whichever one the model picked and returns a numbered, citable block for the tool message, so the model can cite a fetched page the same way it cites a search result. Filters, async and errors are in the SDK reference.
TypeScript, AI SDK
keenableTools() to generateText with an OpenRouter model:
stopWhen lets the model search, read the results and then answer. Without it, generateText stops after the first step and returns only the tool call. The same tools work in streamText. To keep the key out of environment variables on Vercel, see Vercel.
OpenRouter Agent SDK, MCP
callModel:
createMCPTools reads the tool list from the Keenable MCP server and runs the calls, so there is no tool code to write. To use your key, pass it as a header:
Use your API key
Set
KEENABLE_API_KEY to remove the hourly request cap. If you don’t set a key, calls run on the shared keyless tier, which allows 1,000 requests per hour per IP address. See Rate limits.@keenable/ai-sdk read KEENABLE_API_KEY from the environment. The MCP client takes it as the header above. Create a key in the Keenable console.
Billing
OpenRouter bills the model’s tokens, including the search results the model reads. Keenable bills its calls separately to your Keenable organization: 100,000 free requests a month, then $4 per 1,000. See Pricing. Without a key, the calls run on the public tier. This setup is separate from OpenRouter’s ownopenrouter:web_search server tool: Keenable runs as your tool, so it behaves the same on every model and every call goes through your code.
Related pages
Baseten
Keenable web search and page fetch as server-side tools on Baseten Model APIs, called by the model inside the inference loop.
Tool calling
Give an LLM web search and page fetch as tools. Pass the SDK’s TOOLS to any OpenAI-compatible chat completions client and run each call with run_tool_call.
Overview
Install the official Keenable SDK for Python, TypeScript, Go or Rust with one command, search with no key, then add fetch, tool calling and Monitors.
Cerebras
Ground Cerebras Inference models in live web results with the Keenable SDK: one search for cited answers, or tool calling with TOOLS, in Python and Node.