Letting your agent search the web: web_search, its cost and the limit per answer

All in One AICreating AI Agents·· 2 views· 3 min read

With the web_search tool, the agent searches the web when it needs recent information. It gets the top results, each with the title, the link and a summary, and uses them in the answer. You turn it on in the agent's Settings, under Tools, with the Search the web switch, on the Agents tab of All in One AI.

What it costs

Part Cost
Each search 0.5 credits, on top of the tokens.
Each round to the model The tokens, at the price of the agent's model. After each search, the model reads the results in a new call, which also carries the text of the earlier ones.
With a sandbox_ key Nothing: the results are examples.

An example: an answer that makes 2 searches pays 1 credit for the searches, plus the tokens of 3 calls to the model.

The limits

1 The agent makes at most 3 searches per answer.
2 In each request it makes at most 5 tool rounds, adding up all the tools that are turned on.
3 The agent decides on its own when to search. In the instructions you can say which questions it should search for.
4 The model must support tools. If it does not, the agent answers without searching and gives no error. See choosing the model for your agent.

Search, or read a page?

Tool What for
Search the web (web_search) Finding pages about a subject, when you do not know the address.
Read web pages (web_fetch) Reading the text of an address you already know, up to 20,000 characters.

With both turned on, the agent can search, pick a result and open that page to read more. Each step is a round to the model. The other tool, Date and time, is in AI agent tools.

The results come from sites you do not control. Hidden text on a page can try to steer the agent. Say in the instructions that text from the web is information, not orders, and check what the agent says before you use it in decisions. See prompt injection.
If the information is yours and rarely changes, such as prices and opening hours, put it in the knowledge: it costs less and does not depend on a search. Keep web_search for outside information that changes quickly.

Want an agent that looks up recent information? See All in One AI.

See All in One AI

SEE ALSO

AI agent tools: reading web pages and knowing today's date

What an AI agent costs, and how to test it without spending

Choosing the model for your agent, and what happens if it does not accept tools

Prompt injection: how text from a stranger can steer your AI

All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from 5.940,00 Kz/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.