Skip to main content
The @geekflare/ai-sdk package gives the Vercel AI SDK Geekflare as a set of tools: web and Google SERP search, page scraping to Markdown or structured JSON, screenshots, and website diagnostics. It works with AI SDK 5, 6, and 7, requires zod 3.25+ or 4 and Node 18+, supports both ESM and CJS, and has no dependencies beyond the ai and zod peers.

Install

Set the API key

Get an API key at dash.geekflare.com and set it as an environment variable:
Replace YOUR_API_KEY with your Geekflare API key. You can also pass the key to any tool with the apiKey option.

Manage the key with Vercel Connect

On Vercel, you can keep the key out of your code and environment variables with Vercel Connect. You add the key to a Geekflare connector once, and your app fetches it at runtime. From your project folder, link the project and create the connector. The CLI asks for your Geekflare API key:
vercel env pull writes a VERCEL_OIDC_TOKEN to .env.local so getToken also works locally. Deployed functions get this token automatically. Install the Connect SDK, fetch the key, and pass it to the tools with apiKey:
The connector is attached to the project you created it from. To use it in another project, run vercel connect attach from that project.

Quick start

Add geekflareSearch() to generateText so the model can search the web:

All tools

geekflareTools() returns all four tools, keyed by name:

Options

Every tool accepts these options: Some tools also take defaults that apply when the model doesn’t set them:

Errors

API errors (such as an invalid key, no credits, or an unreachable site) throw GeekflareAPIError with the message from the API. The AI SDK returns it to the model as a tool error, so the model can read the message and respond.

Notes

  • Each call spends credits from your Geekflare account. See Credit Consumption and pricing.
  • Geekflare works with public pages only.

npm

@geekflare/ai-sdk on npm.

GitHub

Source code (MIT license).

LangChain

Use Geekflare tools in LangChain agents.

LlamaIndex

Use Geekflare tools in LlamaIndex agents.

MCP Server

Connect Geekflare to AI clients through MCP.