> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trylimitless.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web search and fetch

> Use hosted web tools through each supported inference protocol.

Hosted web tools execute through the inference backend. Availability and tool-specific settings depend on the selected model. They are separate from [custom functions](/guides/tool-calling), which your application executes.

## Responses search

Use the same OpenAI client as the [quickstart](/quickstart):

```javascript theme={null}
const result = await client.responses.create({
  model: process.env.LIMITLESS_MODEL,
  input: "Find the official IANA explanation of reserved example domains.",
  tools: [{ type: "web_search", filters: { allowed_domains: ["iana.org"] } }],
  tool_choice: "required",
  max_output_tokens: 2048,
  store: false,
});
console.log(result.output_text);
```

Accepted types are `web_search`, `web_search_preview`, `web_search_2025_08_26`, and `web_search_preview_2025_03_11`. `tool_choice` can be `auto`, `required`, `none`, or `{ "type": "web_search" }`. Domain values contain a hostname, without a URL scheme.

Streaming Responses can contain `web_search_call` output items alongside text events. Reconcile items by ID; do not append the final response's text to text already displayed from deltas. Handle terminal errors and incomplete responses.

## Chat search

Chat uses a top-level `web_search_options` object:

```javascript theme={null}
const result = await client.chat.completions.create({
  model: process.env.LIMITLESS_MODEL,
  messages: [{ role: "user", content: "Find the official IANA example-domain page." }],
  web_search_options: {},
  max_tokens: 2048,
});
console.log(result.choices[0]?.message);
```

Do not combine `web_search_options` with a non-empty `tools` array. Read any returned citation annotations when presenting sources.

## Messages search and fetch

Messages accepts native hosted tool definitions:

```json theme={null}
{
  "tools": [
    {
      "type": "web_search_2025_03_05",
      "name": "web_search",
      "max_uses": 2,
      "allowed_domains": ["iana.org"],
      "blocked_domains": ["example.net"]
    },
    {
      "type": "web_fetch_2025_03_05",
      "name": "web_fetch",
      "max_uses": 2
    }
  ]
}
```

Domain filters belong directly on the Messages tool, unlike Responses' `filters.allowed_domains`. Hosted results can contain `server_tool_use`, `web_search_tool_result`, and `web_fetch_tool_result` blocks. These are not requests for your application to execute a function. The current backend may reject replayed hosted tool blocks; retain supported conversational content when constructing another turn.

Limitless currently charges the reported model tokens at your configured rates. It does not add a separate search or fetch fee. Search results can increase token usage. This release does not expose per-project web-domain settings in its administration API.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.