← Back to Plugins
Tools

Independent Openrouter Sonar Pro Search

jwong-art By jwong-art 👁 15 views ▲ 0 votes

OpenClaw plugin for independent OpenRouter Perplexity Sonar Pro Search

GitHub

Install

npm install
npm

README

# 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

```bash
openclaw plugins install npm:@jwongart/[email protected]
```

## Tool

- `sonar_pro_search`: calls OpenRouter Chat Completions with `model=perplexity/sonar-pro-search`.

### Inputs

- `query` (required): the question or search task.
- `search_depth`: `standard` or `deep`.
- `recency`: `any`, `day`, `week`, `month`, or `year`.
- `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 in `details.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:

1. `OPENROUTER_API_KEY` from the Gateway process environment.
2. `env.OPENROUTER_API_KEY` from `~/.openclaw/openclaw.json`.
3. `models.providers.openrouter.apiKey` from `~/.openclaw/openclaw.json`.

The API key is never returned in tool output.

## Build

```bash
npm install
npm run plugin:build
npm run plugin:validate
npm test
```

## License

MIT
tools

Comments

Sign in to leave a comment

Loading comments...