Guides
Web Search
Web Search
Let Aivana use live web information when a question needs it.
Aivana answers most questions from its own intelligence. For questions about recent events, current figures or a specific web page, live web information gives a better answer. Web search is a setting you control per request.
Controlling search
| web_search | Behavior |
|---|---|
| true | Web search is allowed. Aivana decides for each message whether it needs one: a question about today's news is searched, a greeting is not. This is the same setting as Web Search Allowed in the Playground. |
| false | The request never searches. |
| left out | An API-key request doesn't search. In the Playground, leaving it out is the same as Allowed. |
curl https://api.aivana.ai/v1/generate \
-H "X-API-Key: $AIVANA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt": "What changed in the latest Node.js release?", "web_search": true}'When search is off
If a question asks for the web ("search the web for…", a link to read) while search is off, the answer is written without searching, and the response's notices include web_search_off so your application can tell your user. An answer is never passed off as searched when it wasn't.
In the Intelligence Trace
When you request the Intelligence Trace, its summary shows under Fresh Data whether live web information was used for the request.
Usage and billing
A request that searches the web is charged every token used to answer it, not only your prompt and the answer, so it uses more tokens than the same question without search. The part served from cache is charged as cached input. If your balance can't cover a search, the search is left out. A question that doesn't need one is answered as usual; one that does (for example "search the web for…") is refused with a 402 that says so, and is never answered as if it had searched. Turn web search off to get an answer without one.
Usage & Insights includes runs that searched when it estimates how your cost compares with a benchmark. The separate fees for the search itself are left out of that comparison.
Learn more
Parameters
Every option the Generate API accepts.
Try the Playground
Experiment with Aivana MMI — no account or code required.
Quickstart Guide
Get your key and make your first request in minutes.
Still have questions? We are here to help!