Vercel AI SDK - cloro
Integrations
Vercel AI SDK
Use the @cloro-dev/ai-sdk package to give Vercel AI SDK agents tools for Google Search with the AI Overview and for answers from ChatGPT and other engines.
The
@cloro-dev/ai-sdk
npm package wraps cloro’s
sync monitor endpoints
as
Vercel AI SDK
tools. Each tool is a factory that returns an AI SDK
tool()
with a Zod input schema and a typed output. The source lives in the
cloro-ai-sdk repository
.
Navigate to header: Prerequisites Prerequisites
ai 6 or 7, and zod 3.25.76 or later
A cloro API key from the dashboard (see Authentication )
Navigate to header: Install the package Install the package
npm
install
@cloro-dev/ai-sdk
ai
zod
The tools read
CLORO_API_KEY
from the environment when they run. You can also pass it to each tool:
webSearch({ apiKey: "YOUR_API_KEY" })
.
Navigate to header: Use with an agent Use with an agent
import
{
generateText
,
isStepCount
}
from
"ai"
;
import
{
webSearch
}
from
"@cloro-dev/ai-sdk"
;
const
{
text
}
=
await
generateText
({
model:
"openai/gpt-5-mini"
,
prompt:
"What is the boiling point of water at 2,000 meters?"
,
tools:
{
webSearch:
webSearch
(),
},
stopWhen:
isStepCount
(
3
),
});
With
ai
6, use
stepCountIs
in place of
isStepCount
.
Navigate to header: Available tools Available tools
| Tool | Endpoint | The model sends | The tool returns |
|---|---|---|---|
| webSearch | POST /v1/monitor/google | query | The AI Overview text and its sources, and the organic results with title, link and snippet |
| aiAnswer | POST /v1/monitor/chatgpt , gemini , aimode or bing/aimode | prompt | The engine’s answer and the sources it cites |
Both tools accept
apiKey
and
country
(ISO 3166-1 alpha-2, defaults to
"US"
).
webSearch
also takes
maxResults
(1 to 10) and
includeAiOverview
(defaults to
true
;
false
saves 2 credits).
aiAnswer
takes
engine
:
"chatgpt"
(default),
"gemini"
,
"google-ai-mode"
or
"bing-ai-mode"
. To give the model more than one engine, make one tool for each engine.
Every call is a sync request, so it costs the
provider rate
plus the sync surcharge: 7 credits for
webSearch
with the AI Overview.
Was this page helpful?
Ask a question...
Navigate to header: Prerequisites
Navigate to header: Install the package