perplexity by vm0-ai/vm0-skills
npx skills add https://github.com/vm0-ai/vm0-skills --skill perplexity提供基于实时网络信息并附有来源引用的 AI 搜索引擎。与传统搜索不同,Perplexity 会综合多个来源的信息,生成连贯的回应。
在以下情况时使用此技能:
设置环境变量:
export PERPLEXITY_API_KEY="pplx-your-api-key"
具备网络搜索和引用功能的 AI 问答。兼容 OpenAI SDK。
使用 sonar 模型进行基本查询:
写入 /tmp/perplexity_request.json:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
{
"model": "sonar",
"messages": [
{"role": "user", "content": "What is the current price of Bitcoin?"}
]
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
使用系统提示词:
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "system", "content": "Be precise and concise. Answer in bullet points."},
{"role": "user", "content": "What are the latest developments in AI?"}
]
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
使用 sonar-pro 进行高级查询:
写入 /tmp/perplexity_request.json:
{
"model": "sonar-pro",
"messages": [
{"role": "user", "content": "Compare the latest iPhone and Samsung Galaxy flagship phones"}
],
"temperature": 0.2,
"web_search_options": {
"search_context_size": "high"
}
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
将搜索限制在特定域名。
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Latest research on transformer architectures"}
],
"search_domain_filter": ["arxiv.org", "openai.com", "anthropic.com"]
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
排除域名(添加 - 前缀):
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Best programming practices"}
],
"search_domain_filter": ["-reddit.com", "-quora.com"]
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
按新近程度过滤。
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Major tech news"}
],
"search_recency_filter": "week"
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
按日期范围过滤:
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "AI announcements"}
],
"search_after_date_filter": "12/01/2024",
"search_before_date_filter": "12/31/2024"
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
搜索学术来源。
写入 /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Recent papers on large language model alignment"}
],
"search_mode": "academic"
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
获取未经 AI 综合的原始搜索结果。
写入 /tmp/perplexity_request.json:
{
"query": "Claude AI Anthropic",
"max_results": 5
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
使用域名和时间过滤器:
写入 /tmp/perplexity_request.json:
{
"query": "machine learning tutorials",
"max_results": 10,
"search_domain_filter": ["github.com", "medium.com"],
"search_recency_filter": "month",
"country": "US"
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
用于全面的研究报告。
写入 /tmp/perplexity_request.json:
{
"model": "sonar-deep-research",
"messages": [
{"role": "user", "content": "Write a comprehensive analysis of the electric vehicle market in 2024"}
],
"reasoning_effort": "high"
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
用于复杂问题解决。
写入 /tmp/perplexity_request.json:
{
"model": "sonar-reasoning-pro",
"messages": [
{"role": "user", "content": "Analyze the pros and cons of microservices vs monolithic architecture for a startup"}
]
}
然后运行:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
| 模型 | 描述 | 最佳用途 |
|---|---|---|
sonar | 轻量级,性价比高 | 快速事实、新闻、简单问答 |
sonar-pro | 高级搜索,理解更深 | 复杂查询、详细研究 |
sonar-reasoning-pro | 带搜索的多步推理 | 问题解决、分析 |
sonar-deep-research | 详尽研究、报告 | 学术研究、市场分析 |
聊天补全返回:
{
"id": "uuid",
"model": "sonar",
"choices": [
{
"message": {
"role": "assistant",
"content": "The answer with [1] citations..."
}
}
],
"citations": ["https://source1.com", "https://source2.com"],
"search_results": [
{
"title": "Source Title",
"url": "https://source.com",
"snippet": "Relevant excerpt..."
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 150,
"total_tokens": 160
}
}
sonar,复杂查询用 sonar-prosearch_context_size 可减少成本(低/中/高)- 前缀排除day、week、month、year[1],映射到 citations 数组周安装量
81
代码仓库
GitHub Stars
47
首次出现
2026 年 1 月 24 日
安全审计
安装于
gemini-cli74
opencode73
codex72
github-copilot71
amp70
kimi-cli69
AI search engine that provides real-time web-grounded answers with source citations. Unlike traditional search, Perplexity synthesizes information from multiple sources into coherent responses.
Official docs: https://docs.perplexity.ai/
Use this skill when you need to:
Set environment variable:
export PERPLEXITY_API_KEY="pplx-your-api-key"
AI-powered Q&A with web search and citations. OpenAI SDK compatible.
Basic query with sonar model:
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "What is the current price of Bitcoin?"}
]
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
With system prompt:
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "system", "content": "Be precise and concise. Answer in bullet points."},
{"role": "user", "content": "What are the latest developments in AI?"}
]
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Advanced query with sonar-pro:
Write to /tmp/perplexity_request.json:
{
"model": "sonar-pro",
"messages": [
{"role": "user", "content": "Compare the latest iPhone and Samsung Galaxy flagship phones"}
],
"temperature": 0.2,
"web_search_options": {
"search_context_size": "high"
}
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Limit search to specific domains.
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Latest research on transformer architectures"}
],
"search_domain_filter": ["arxiv.org", "openai.com", "anthropic.com"]
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Exclude domains (add- prefix):
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Best programming practices"}
],
"search_domain_filter": ["-reddit.com", "-quora.com"]
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Filter by recency.
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Major tech news"}
],
"search_recency_filter": "week"
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Filter by date range:
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "AI announcements"}
],
"search_after_date_filter": "12/01/2024",
"search_before_date_filter": "12/31/2024"
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Search academic sources.
Write to /tmp/perplexity_request.json:
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Recent papers on large language model alignment"}
],
"search_mode": "academic"
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
Get raw search results without AI synthesis.
Write to /tmp/perplexity_request.json:
{
"query": "Claude AI Anthropic",
"max_results": 5
}
Then run:
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
With domain and time filters:
Write to /tmp/perplexity_request.json:
{
"query": "machine learning tutorials",
"max_results": 10,
"search_domain_filter": ["github.com", "medium.com"],
"search_recency_filter": "month",
"country": "US"
}
Then run:
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
For comprehensive research reports.
Write to /tmp/perplexity_request.json:
{
"model": "sonar-deep-research",
"messages": [
{"role": "user", "content": "Write a comprehensive analysis of the electric vehicle market in 2024"}
],
"reasoning_effort": "high"
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
For complex problem-solving.
Write to /tmp/perplexity_request.json:
{
"model": "sonar-reasoning-pro",
"messages": [
{"role": "user", "content": "Analyze the pros and cons of microservices vs monolithic architecture for a startup"}
]
}
Then run:
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $(printenv PERPLEXITY_API_KEY)" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
| Model | Description | Best For |
|---|---|---|
sonar | Lightweight, cost-effective | Quick facts, news, simple Q&A |
sonar-pro | Advanced search, deeper understanding | Complex queries, detailed research |
sonar-reasoning-pro | Multi-step reasoning with search | Problem-solving, analysis |
sonar-deep-research | Exhaustive research, reports | Academic research, market analysis |
Chat completions return:
{
"id": "uuid",
"model": "sonar",
"choices": [
{
"message": {
"role": "assistant",
"content": "The answer with [1] citations..."
}
}
],
"citations": ["https://source1.com", "https://source2.com"],
"search_results": [
{
"title": "Source Title",
"url": "https://source.com",
"snippet": "Relevant excerpt..."
}
],
"usage": {
"prompt_tokens": 10,
"completion_tokens": 150,
"total_tokens": 160
}
}
sonar for simple queries, sonar-pro for complex onessearch_context_size reduces costs (low/medium/high)- prefix to excludeday, week, month, yearWeekly Installs
81
Repository
GitHub Stars
47
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli74
opencode73
codex72
github-copilot71
amp70
kimi-cli69
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
50,500 周安装
Google Workspace CLI 命令行工具 gws-shared 使用指南:安装、认证与API调用
11,000 周安装
卓越代码审查指南:提升团队协作与代码质量的实用技巧与清单
11,100 周安装
Google Slides API 命令行工具 - gws-slides 批量管理与自动化操作指南
11,500 周安装
Nuxt 3 全栈 Vue 框架教程:服务器端渲染、文件路由与模块开发
11,700 周安装
VueUse函数指南:Vue.js/Nuxt组合式函数决策与实现,提升开发效率
11,800 周安装
Vitest 3.x 测试框架:Vite 驱动的下一代 JavaScript/TypeScript 测试工具
12,100 周安装
[1] that map to citations array