Docs menu
DocsAPI reference

Web search & fetch

web.search and web.fetch, plus the built-in web tools for chat turns.

Declare webSearch and the model can call the OS's web_search / web_fetch tools during a chat.runTurn — ChatOSS answers them itself (your onToolCall is not called for them). See AI chat for runTurn.

You can also search directly:

const results = await window.chatoss.web.search('latest Ollama release', 5);
// → [{ title, url, content }]
const page = await window.chatoss.web.fetch('https://example.com');
// → { title, content, links }

Web access rides the user's backend (a signed-in Ollama account, or a paid ChatOSS plan). When neither is available, the tools aren't advertised and web.search/web.fetch reject with a clear error.

  • Need to call a specific REST/GraphQL API instead of searching? That's hostHttp.
  • Need to open a website for the user to browse? That's webview.