Capabilities
Compatibility
Verification
Tags
independent-openrouter-sonar-pro-search
OpenClaw tool plugin that exposes sonar_pro_search, an independent OpenRouter Perplexity Sonar Pro Search tool.
This tool consumes OpenRouter credits, but the search quality is strong. It can work independently of OpenClaw's built-in web_search. Use it when the built-in web_search results are not satisfactory and better search results are needed.
Install
openclaw plugins install npm:@jwongart/independent-openrouter-sonar-pro-search@0.0.5
Configuration
The tool input mirrors OpenRouter request fields, so request timeout is configured at plugin level:
{
"plugins": {
"entries": {
"independent-openrouter-sonar-pro-search": {
"config": {
"timeout_ms": 120000
}
}
}
}
}
timeout_ms: request timeout in milliseconds, from15000to300000. Default is120000.
Tool
sonar_pro_search: calls OpenRouter Chat Completions withmodel=perplexity/sonar-pro-search.
Inputs
Inputs mirror the OpenRouter perplexity/sonar-pro-search Chat Completions API fields that OpenRouter currently reports for this model. The plugin fixes model to perplexity/sonar-pro-search.
messages(required): OpenRouter Chat Completions messages array.max_tokens: maximum output tokens. OpenRouter currently reportsmax_completion_tokens=8000for this model.temperature,top_p,top_k,frequency_penalty,presence_penalty: OpenRouter request parameters.reasoning,include_reasoning,response_format: OpenRouter request parameters for reasoning and structured output behavior.web_search_options: Perplexity/OpenRouter native web search options, includingsearch_context_sizeanduser_location.
OpenRouter model metadata currently lists these supported parameters for this model: frequency_penalty, include_reasoning, max_tokens, presence_penalty, reasoning, structured_outputs, temperature, top_k, top_p, and web_search_options. Perplexity direct-API fields such as search_domain_filter and search_recency_filter are not exposed here unless OpenRouter adds them to this model's supported parameters.
Output
The tool returns natural-language content for OpenClaw plus structured details:
content: the full Sonar Pro answer, a compactResourceslist, plus model and any returned usage/cost summary such asUsage: 23 prompt + 28 completion = 51 tokensandEstimated cost: $0.00649. Resources prefer OpenRoutersearch_resultswhen returned, then fall back to citations/annotations. Each resource uses a natural display style: title plus URL when a title exists, optional snippet text only when OpenRouter returns a real snippet-like field (snippet,content,text, ordescription), and URL-only citations stay URL-only. Snippets are capped to keep tool output compact.details.openrouterRequest: the exact JSON body sent to OpenRouter.details.openrouterResponse: the raw OpenRouter Chat Completions response, including fields such asid,model,created,choices,usage, and provider-specific fields such as citations when returned.details.retryCount: retry count for transient 429/5xx/network failures.
API Key
The plugin reads the OpenRouter API key in this order:
OPENROUTER_API_KEYfrom the Gateway process environment.env.OPENROUTER_API_KEYfrom~/.openclaw/openclaw.json.models.providers.openrouter.apiKeyfrom~/.openclaw/openclaw.json.
The API key is never returned in tool output.
Build
npm install
npm run plugin:build
npm run plugin:validate
npm test
License
MIT
