Add Web Search to Any LLM API Call: The :online Suffix
Give any model live web results and citations with a model-name suffix or a plugin option. Copy-paste examples, depth levels, filters and billing rules.
Language models know what they were trained on. For anything after that cutoff, such as prices, release notes, news or a library's newest API, they guess. The usual fix is to build a search step yourself: pick a search API, call it, trim the results, paste them into the prompt, and hope the model cites them.
BazaarLink turns that into a single change to the request. You add web search to the call you already make, and you get the answer back with source links.
The one-line version
Append :online to the model name:
curl https://bazaarlink.ai/api/v1/chat/completions \
-H "Authorization: Bearer $BAZAARLINK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-luna:online",
"messages": [{"role": "user", "content": "What changed in the latest Node.js LTS release?"}]
}'
The request is searched first, the results are handed to the model, and the answer comes back with citations.
Three equivalent ways to turn it on
| Method | Use it when |
|---|---|
"model": "<model>:online" | You want the smallest change. Works with any model ID. |
"plugins": [{"id": "web", "max_results": 5}] | You want to set the number of sources per request. |
"web_search_options": {"search_context_size": "high"} | You already use the OpenAI-style option and want to pick depth. |
They can be combined in one request; only one search runs per request. They work on Chat Completions, Responses and Messages, streaming or not.
Choose how deep to search
search_context_size sets the depth:
| Level | Depth | Default results | Good for |
|---|---|---|---|
low | Standard | 5 | Quick fact checks |
medium (default) | Standard | 10 | General questions |
high | Advanced | 10 | Multi-source comparisons, research |
fast | Quick | 10 | Latency-sensitive chat |
Deeper levels cost more per search. Search is billed separately from model tokens, per search.
Narrow the results
Extra options go in the same plugin or options object:
| Option | Values | Effect |
|---|---|---|
country | e.g. taiwan, japan | Prefer sources from a region |
language | ISO 639-1, e.g. ja | Prefer a language |
topic | general, news | Switch to news-style results |
time_range | day, week, month, year | Only recent content |
max_results | 1–10 | Number of citations |
query_source | last_user, conversation | Search the last message or the whole conversation |
search_prompt | text | Write the search query yourself |
Example: last week's news, Japanese sources, three citations:
{
"model": "claude-sonnet-5.5",
"messages": [{"role": "user", "content": "AI regulation updates"}],
"plugins": [{
"id": "web",
"max_results": 3,
"topic": "news",
"time_range": "week",
"language": "ja"
}]
}
Reading the citations
Sources come back as url_citation objects in annotations:
{
"type": "url_citation",
"url_citation": {
"url": "https://example.com/article",
"title": "Article title",
"content": "Source excerpt…",
"start_index": 0,
"end_index": 0
}
}
If the model did not annotate a span of the answer, start_index and end_index are both 0. In streaming mode the annotations arrive in a final block before [DONE].
When you are charged
- A search that fails (HTTP 503
web_search_unavailable) is not charged. - A request rejected for insufficient balance before the search runs is not charged.
- If model generation fails after the search, you are not charged for the search.
- When you send several queries, only successful ones are charged.
- Free models still incur the search fee, because search is a separate line item.
Moving existing code
The parameter format is compatible with the common OpenRouter-style web search options. If your code already uses :online or the web plugin, change the base URL and API key. Nothing else needs to change.
Where this fits
- Support and sales assistants that must quote current pricing or policy pages.
- Coding assistants that need the newest library docs.
- Research agents that need dated, linkable sources.
- Any workflow that used to depend on a retired search API and needs a maintained replacement.
Get an API key and try the :online suffix on your next request. The full option list is in the docs under Web Search.
For the four tools and pricing, see Tavily-style AI search API: Search, Extract, Crawl & Map.
TWD billing · Taiwan invoices · leading AI models · OpenAI-compatible API