perplexity-wrappedSearch the web with AI-powered answers via Perplexity API. Supports three modes - Search API (ranked results), Sonar API (AI answers with citations, default), and Agentic Research API (third-party models with tools). All responses wrapped in untrusted-content boundaries for security.
Install via ClawdBot CLI:
clawdbot install VACInc/perplexity-wrappedAI-powered web search with three distinct API modes for different use cases.
Default mode (Sonar) - AI answer with citations:
node {baseDir}/scripts/search.mjs "what's happening in AI today"
Search mode - ranked results:
node {baseDir}/scripts/search.mjs "latest AI news" --mode search
Deep research - comprehensive analysis (requires --yes):
node {baseDir}/scripts/search.mjs "compare quantum computing approaches" --deep --yes
AI-generated answers with web grounding and citations. Best for natural language queries.
Models:
sonar (default) - Fast, web-grounded responses (~$0.01/query)sonar-pro - Higher quality, more thorough (~$0.02/query)sonar-reasoning-pro - Advanced reasoning capabilitiessonar-deep-research - Comprehensive research mode (~$0.40-1.30/query)Examples:
# Default sonar
node {baseDir}/scripts/search.mjs "explain quantum entanglement"
# Sonar Pro (higher quality)
node {baseDir}/scripts/search.mjs "analyze 2024 tech trends" --pro
# Deep Research (comprehensive)
node {baseDir}/scripts/search.mjs "future of renewable energy" --deep
# Specific model
node {baseDir}/scripts/search.mjs "query" --model sonar-reasoning-pro
Output format:
<<<EXTERNAL_UNTRUSTED_CONTENT>>>
Source: Web Search
---
[AI-generated answer text with inline context]
## Citations
[1] Title
https://example.com/source1
[2] Title
https://example.com/source2
<<<END_EXTERNAL_UNTRUSTED_CONTENT>>>
Ranked web search results with titles, URLs, and snippets. Best for finding specific sources.
Cost: ~$0.005 per query
Examples:
# Single query
node {baseDir}/scripts/search.mjs "best coffee shops NYC" --mode search
# Batch queries (multiple in one API call)
node {baseDir}/scripts/search.mjs "query 1" "query 2" "query 3" --mode search
Output format:
<<<EXTERNAL_UNTRUSTED_CONTENT>>>
Source: Web Search
---
**Result Title**
https://example.com/url
Snippet text from the page...
**Another Result**
https://example.com/url2
Another snippet...
<<<END_EXTERNAL_UNTRUSTED_CONTENT>>>
Advanced mode with third-party models (OpenAI, Anthropic, Google, xAI), web_search and fetch_url tools, and structured outputs.
Options:
--reasoning low|medium|high - Control reasoning effort for reasoning models--instructions "..." - System instructions for the model--model - Model selection (default: openai/gpt-5-mini)Available Models:
| Provider | Model | Input $/1M | Output $/1M |
|----------|-------|-----------|------------|
| Perplexity | perplexity/sonar | $0.25 | $2.50 |
| OpenAI | openai/gpt-5-mini ⭐ | $0.25 | $2.00 |
| OpenAI | openai/gpt-5.1 | $1.25 | $10.00 |
| OpenAI | openai/gpt-5.2 | $1.75 | $14.00 |
| Anthropic | anthropic/claude-haiku-4-5 | $1.00 | $5.00 |
| Anthropic | anthropic/claude-sonnet-4-5 | $3.00 | $15.00 |
| Anthropic | anthropic/claude-opus-4-5 | $5.00 | $25.00 |
| Google | google/gemini-2.5-flash | $0.30 | $2.50 |
| Google | google/gemini-2.5-pro | $1.25 | $10.00 |
| Google | google/gemini-3-flash-preview | $0.50 | $3.00 |
| Google | google/gemini-3-pro-preview | $2.00 | $12.00 |
| xAI | xai/grok-4-1-fast-non-reasoning | $0.20 | $0.50 |
Examples:
# Basic agentic query
node {baseDir}/scripts/search.mjs "analyze climate data" --mode agentic
# With high reasoning effort
node {baseDir}/scripts/search.mjs "solve complex problem" --mode agentic --reasoning high
# With custom instructions
node {baseDir}/scripts/search.mjs "research topic" --mode agentic --instructions "Focus on academic sources"
# Custom model
node {baseDir}/scripts/search.mjs "query" --mode agentic --model "anthropic/claude-3.5-sonnet"
Output format:
<<<EXTERNAL_UNTRUSTED_CONTENT>>>
Source: Web Search
---
[AI-generated output with inline citation markers]
## Citations
[1] Citation Title
https://example.com/source
<<<END_EXTERNAL_UNTRUSTED_CONTENT>>>
node {baseDir}/scripts/search.mjs <query> [options]
MODES:
--mode search Search API - ranked results (~$0.005/query)
--mode sonar Sonar API - AI answers [DEFAULT] (~$0.01/query)
--mode agentic Agentic Research API - third-party models with tools
SONAR OPTIONS:
--model <model> sonar | sonar-pro | sonar-reasoning-pro | sonar-deep-research
--deep Shortcut for --mode sonar --model sonar-deep-research (requires --yes)
--yes, -y Confirm expensive operations (required for --deep)
--pro Shortcut for --model sonar-pro
AGENTIC OPTIONS:
--reasoning <level> low | medium | high
--instructions "..." System instructions for model behavior
--model <model> Third-party model (default: openai/gpt-5-mini)
See "Available Models" above for full list
GENERAL OPTIONS:
--json Output raw JSON (debug mode, unwrapped)
--help, -h Show help message
Estimates assume a typical query (~500 input tokens, ~500 output tokens).
| Model | Est. Cost/Query | Breakdown |
|-------|----------------|-----------|
| sonar | ~$0.006 | $0.001 tokens + $0.005 request fee |
| sonar-pro | ~$0.015 | $0.009 tokens + $0.006 request fee |
| sonar-reasoning-pro | ~$0.011 | $0.005 tokens + $0.006 request fee |
| sonar-deep-research ⚠️ | ~$0.41-1.32 | Tokens + citations + reasoning + 18-30 searches |
Request fees vary by search context size (low/medium/high). Estimates above use low context.
| Model | Est. Cost/Query | Notes |
|-------|----------------|-------|
| xai/grok-4-1-fast-non-reasoning | ~$0.005 | Cheapest, fastest |
| perplexity/sonar | ~$0.006 | |
| openai/gpt-5-mini ⭐ | ~$0.006 | Default — best value |
| google/gemini-2.5-flash | ~$0.006 | |
| google/gemini-3-flash-preview | ~$0.007 | |
| anthropic/claude-haiku-4-5 | ~$0.008 | |
| openai/gpt-5.1 | ~$0.011 | |
| google/gemini-2.5-pro | ~$0.011 | |
| google/gemini-3-pro-preview | ~$0.012 | |
| openai/gpt-5.2 | ~$0.013 | |
| anthropic/claude-sonnet-4-5 | ~$0.014 | |
| anthropic/claude-opus-4-5 | ~$0.020 | Most expensive |
Agentic costs scale with tool usage — complex queries may trigger multiple web_search/fetch_url calls.
| API | Cost |
|-----|------|
| Search API | ~$0.005/query (flat $5/1K requests) |
Deep Research mode requires --yes flag (or interactive TTY confirmation) due to high cost (~$0.40-1.32 per query). Without it, the script exits with a cost warning.
Set your Perplexity API key in OpenClaw config:
{
"skills": {
"entries": {
"perplexity_wrapped": {
"enabled": true,
"apiKey": "pplx-your-key-here"
}
}
}
}
OpenClaw sets PERPLEXITY_API_KEY env var from this config value. You can also export it manually.
All output modes (except --json) wrap results in untrusted-content boundaries:
<<<EXTERNAL_UNTRUSTED_CONTENT>>>
Source: Web Search
---
[content]
<<<END_EXTERNAL_UNTRUSTED_CONTENT>>>
Security features:
--json requires explicit opt-inBest practices:
--json only when you need raw payloads for debuggingCustom model with agentic mode:
node {baseDir}/scripts/search.mjs "complex analysis" \
--mode agentic \
--model "openai/o1" \
--reasoning high \
--instructions "Provide step-by-step reasoning"
Raw JSON for debugging:
node {baseDir}/scripts/search.mjs "query" --json
Batch search queries:
node {baseDir}/scripts/search.mjs \
"What is AI?" \
"Latest tech news" \
"Best restaurants NYC" \
--mode search
"Could not resolve API key"
PERPLEXITY_API_KEY env var is setapiKey is set in OpenClaw config under skills.entries.perplexity_wrapped"Invalid mode" error
search, sonar, agentic"Invalid reasoning level" error
low, medium, highCost concerns
2.1.0 - Agentic API fix + 1Password integration
/v2/responses instead of /chat/completions)openai/gpt-5-mini (gpt-4o deprecated on Perplexity)op CLI) integration for API key resolutionconfig.mjs from search.mjs for security scanner compatibility2.0.0 - Multi-API support
--deep and --pro shortcuts1.0.0 - Initial release
Generated Mar 1, 2026
Startups can use the Sonar API to quickly gather AI-generated insights and citations on industry trends, competitor analysis, or customer needs, enabling data-driven decision-making without extensive manual research. The agentic mode with custom instructions allows for tailored, in-depth reports from academic or technical sources.
Content creators and journalists can leverage the Search API to find ranked sources and snippets for articles, or use the Sonar API to generate AI-powered summaries with citations for breaking news or complex topics. This speeds up research while maintaining credibility through proper attribution.
Students and researchers can utilize the agentic mode with high reasoning effort and custom instructions to analyze scientific literature, compare methodologies, or gather comprehensive data from web sources. The deep research option provides thorough analysis for complex queries like literature reviews.
Large organizations can employ the agentic mode with third-party models like Claude or GPT to conduct advanced market analysis, forecast trends, or evaluate risks, using structured outputs for integration into internal reports. The cost-effective Search API helps in sourcing specific data points efficiently.
Offer a monthly subscription where clients receive a set number of AI-powered search queries with detailed reports and citations, targeting small businesses or freelancers who need regular market insights. Revenue is generated through tiered pricing based on query volume and API mode usage.
Integrate the skill into existing platforms (e.g., CRM or content management systems) and charge users per query based on the API mode selected, such as Sonar for quick answers or agentic for deep analysis. This model appeals to developers and enterprises needing flexible, scalable search capabilities.
License the skill as a white-labeled solution for consulting firms or educational institutions, allowing them to rebrand it for internal use or client-facing services. Revenue comes from one-time setup fees and ongoing support contracts, with customization options for specific industries.
💬 Integration Tip
Ensure Node.js is installed and API keys are securely configured; use the --json flag for debugging and programmatic integration into other applications.
Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).
AI-optimized web search via Tavily API. Returns concise, relevant results for AI agents.
This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.
Web search and content extraction via Brave Search API. Use for searching documentation, facts, or any web content. Lightweight, no browser required.
Search indexed Discord community discussions via Answer Overflow. Find solutions to coding problems, library issues, and community Q&A that only exist in Discord conversations.
Multi search engine integration with 17 engines (8 CN + 9 Global). Supports advanced search operators, time filters, site search, privacy engines, and WolframAlpha knowledge queries. No API keys required.