perplexity
Skill1 starsChanged 4 months agoApache-2.0View on GitHub
Web-grounded Q&A with citations via Perplexity's Sonar API. Use when the user says "ask perplexity", "get an AI answer with citations", "web-grounded answer", "answer with sources", "reason about" / "compare" / "evaluate tradeoffs" over live web data, or "deep research" / "literature review" / "comprehensive investigation". The Sonar models search, synthesize, and cite in a single call — reach for this over raw result lists when you want a written answer backed by sources. Bundled curl-based skill (Perplexity ships no official CLI or Agent Skills).
- Reads credentials
8 other projects use a version of this.
Adopted by
Most recently taken up by
- rezkam/boring-but-goodtheir own version, first seen Nov 1, 2026
- imMamdouhaboammar/kaku-chatgpt-harnesstheir own version, first seen Oct 25, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- Samueladewole/claude-skillstheir own version, first seen Oct 13, 2026
- Practice019/agent-skillstheir own version, first seen Sep 9, 2026
- FelipeAngeli/skillstheir own version, first seen Apr 10, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- refly-ai/refly-skills★ 204same name
- aiagenta2z/onekey-gateway★ 52same name
- G1Joshi/Agent-Skills★ 15same name
- FelipeAngeli/skills★ 2same name
- rezkam/boring-but-good★ 1same name
- imMamdouhaboammar/kaku-chatgpt-harness★ 0same name
- Practice019/agent-skills★ 0same name
- Samueladewole/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
No key yet: create one at https://console.perplexity.ai (create an API Group first, then the API Keys tab — the key is shown only once).
- Very specific: line 50
Start cheap (sonar), escalate only when the answer lacks depth.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Perplexity (Sonar API)
Perplexity's Sonar models search the web, synthesize an answer, and return citations in one HTTP call. This skill talks to the official API at https://api.perplexity.ai directly with curl — no CLI to install. Every recipe shows a jq command and a python3 -c fallback, because jq may be absent.
Auth
The key lives in PERPLEXITY_API_KEY. Process environment always wins; the shared env file only fills it when unset.
bash / zsh:
[ -f ~/.config/elnora-websearch/.env ] && while IFS='=' read -r k v; do [ -n "$k" ] && [ -z "$(eval echo \$$k)" ] && export "$k=$v"; done < ~/.config/elnora-websearch/.envPowerShell:
Get-Content "$env:USERPROFILE\.config\elnora-websearch\.env" -ErrorAction SilentlyContinue | ForEach-Object {
$k,$v = $_ -split '=',2
if ($k -and -not (Get-Item "env:$k" -ErrorAction SilentlyContinue)) { Set-Item "env:$k" $v }
}No key yet: create one at https://console.perplexity.ai (create an API Group first, then the API Keys tab — the key is shown only once). Billing is prepaid credits; a card is required at setup but nothing is charged until you buy credits. New accounts are Tier 0.
Router — which recipe
| User intent | Recipe | Model | Reference |
| Find URLs / sources / recent news, raw ranked results | search | (Search API, no LLM) | references/search.md |
| Quick synthesized answer with citations | search | sonar | references/search.md |
| General Q&A, pick depth vs speed | ask | sonar / sonar-pro | references/ask.md |
| Compare, analyze, evaluate tradeoffs (chain-of-thought) | reason | sonar-reasoning-pro | references/reason.md |
| Literature review, market/competitive research, due diligence | research | sonar-deep-research | references/research.md |
| HTTP errors, rate limits, cost | — | — | references/errors-and-limits.md |
Start cheap (sonar), escalate only when the answer lacks depth. Deep research is expensive and slow — read references/research.md before running it.
Models
| Model | Speed | RPM (Tier 0) | Best for |
sonar | 2–5s | 50 | Quick facts, URLs, current events |
sonar-pro | 5–15s | 50 | Complex queries, more citations, multi-step search |
sonar-reasoning-pro | 10–30s | 50 | Comparisons, technical analysis (emits chain-of-thought) |
sonar-deep-research | 30–120s+ | 5 | Literature reviews, comprehensive reports |
Approximate token pricing (verify at https://docs.perplexity.ai/getting-started/pricing): sonar ~$1/$1 per 1M in/out; sonar-pro ~$3/$15; sonar-reasoning-pro ~$2/$8; sonar-deep-research $2/$8 plus per-search and per-citation-token charges. All Sonar calls add a per-request search fee ($5 per 1,000 searches); sonar-pro and deep research may run several searches per call.
Endpoints
- Chat completions (all Sonar models):
POST https://api.perplexity.ai/chat/completions— OpenAI-compatible body. - Search API (raw ranked results, no LLM synthesis):
POST https://api.perplexity.ai/search.
The one call to remember
curl -sS https://api.perplexity.ai/chat/completions \
-H "Authorization: Bearer $PERPLEXITY_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"model":"sonar","messages":[{"role":"user","content":"What is quantum error correction?"}]}'Extract the answer and its sources:
# with jq
RESP=$(curl -sS https://api.perplexity.ai/chat/completions \
-H "Authorization: Bearer $PERPLEXITY_API_KEY" -H 'Content-Type: application/json' \
-d '{"model":"sonar","messages":[{"role":"user","content":"What is quantum error correction?"}]}')
echo "$RESP" | jq -r '.choices[0].message.content'
echo "$RESP" | jq -r '.search_results[]? | "\(.title) — \(.url)"'
# without jq
echo "$RESP" | python3 -c 'import sys,json;d=json.load(sys.stdin);print(d["choices"][0]["message"]["content"])'Response shape (fields the recipes rely on):
{
"id": "...",
"model": "sonar",
"choices": [{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"answer text"}}],
"citations": ["https://source1.com", "https://source2.com"],
"search_results": [{"title":"...","url":"https://...","snippet":"...","date":"2026-01-01"}],
"usage": {"prompt_tokens":50,"completion_tokens":200,"total_tokens":250}
}citations is a flat URL list; search_results carries the same URLs with title/snippet/date. Prefer search_results when you need titles. Both may be empty when the model answers without searching.
Cross-platform note
All curl recipes run as-is in bash/zsh and in PowerShell 7+ (curl is not aliased there when curl.exe is on PATH; if curl resolves to Invoke-WebRequest, call curl.exe). On Windows PowerShell 5.1, use curl.exe explicitly and single-quote the JSON with escaped inner quotes, or pipe the body from a file.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

