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.1
Tool
sonar_pro_search: calls OpenRouter Chat Completions withmodel=perplexity/sonar-pro-search.
Inputs
query(required): the question or search task.search_depth:standardordeep.recency:any,day,week,month, oryear.domains: preferred domains or source names to prioritize.language: preferred answer language.max_tokens: maximum output tokens, from 256 to 8000.temperature: sampling temperature, from 0 to 1.include_raw_response: include the raw OpenRouter response indetails.rawResponse.
Output
The tool returns natural-language content plus structured details containing the answer, citations, usage, model, OpenRouter response id, query, and billing notice.
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