Search Tako through AI Gateway.
A model calls gateway.tools.takoSearch() from the AI SDK 7. Tako searches
its curated knowledge graph and the live web, and you get a cited answer, data cards,
web sources and a receipt.
Question
Tako Search is free on AI Gateway through September 30, 2026, then $7 per 1,000 searches. Deep effort and inline data cost more.
TAKO_AI_GATEWAY_API_KEY is not set on the server. Add it to .env.local and restart the dev server.
Type a question to search · Ctrl+Enter
Answer
Tako returned an error:
No curated data cards for this question.
No web results for this question.
The model has not called the search tool yet.
The AI SDK 7 call your current settings configure.
import { createGateway, isStepCount, streamText } from 'ai'
// Tako runs inside the gateway request as a provider-executed tool,
// so the gateway key covers it: no separate Tako account or key.
const gateway = createGateway({ apiKey: process.env.TAKO_AI_GATEWAY_API_KEY })
const result = streamText({
model: gateway('inclusionai/ling-3.1-flash-free'),
instructions: 'You are a research assistant. Use the tako_search tool to look up curated data and current web information, then answer concisely. Ground every figure in the returned cards or web results, name the source and time period, and say plainly when the search returned nothing relevant. Once the results are enough, stop searching and write the answer itself — never end with a plan to research further. Always call tako_search at least once before answering.',
prompt: 'Your question',
tools: {
tako_search: gateway.tools.takoSearch({
effort: 'fast',
}),
},
stopWhen: isStepCount(5),
// The last step forbids tool calls, so the model has to answer.
prepareStep: ({ stepNumber }) => (stepNumber >= 4 ? { toolChoice: 'none' } : {}),
})
for await (const part of result.stream) {
if (part.type === 'text-delta') process.stdout.write(part.text)
if (part.type === 'tool-result') console.log(part.output.cards, part.output.web_results)
}
Resolved tool config
{
"effort": "fast"
}