Internet Search
The internet_search tool is a built-in tool automatically available on all /v1/chat/completions requests. It uses Perplexity AI Sonar under the hood to search the live web and return a synthesized answer with citations. You don't configure it — the model invokes it automatically when the prompt requires real-time or current information.
How It Works
You send a normal chat request with a question that needs current data
The LLM detects it needs fresh web data and calls
internet_searchinternallyThe tool queries Perplexity Sonar (
temperature: 0.1for accuracy) with your queryPerplexity returns a synthesized answer + citation URLs
The model wraps the answer into a standard chat completion response
Streaming Behavior
Unlike image generation (which delivers the result at the end), internet search integrates naturally with streaming. The stream shows:
A
tool_callschunk announcinginternet_searchwas invokedImmediately followed by content chunks streaming the answer word-by-word
A final
[DONE]chunkA trailing
usagedata chunk (ifstream_options.include_usage: true)
data: {"delta":{"tool_calls":[{"function":{"name":"internet_search",...}}]}}
data: {"delta":{"content":"As"}}
data: {"delta":{"content":" of"}}
...
data: [DONE]
data: {"usage":{...}}
Use Cases & Examples
1. Breaking News / Current Events
2. Live Price / Market Data
3. Combining Search + Reasoning
4. Technical / Developer Queries
Tips & Best Practices
Ask naturally
No special syntax needed — the model detects when to search automatically
Be specific
"Latest React 19 release notes" works better than "React news"
Date context helps
Adding "as of today" or "current" reinforces real-time lookup
Streaming for UX
Use stream: true — answers start flowing within ~1s while search runs
Cost vs knowledge cutoff
For questions within the model's training data, search won't trigger (saves cost)
Citations in output
The model includes source links inline — these are real URLs from Perplexity
Limitations
Powered by
perplexity/sonar— accuracy depends on Perplexity's index freshnessNo control over
numResultsfrom the request body — handled internally (default 5 citations)Does not return raw search results, only the synthesized Perplexity answer
Adds latency (~1–3s) compared to non-search requests
temperatureis fixed at0.1internally for factual accuracy — not overridable
Last updated
Was this helpful?