perplexity
Perplexity API for AI search. Use when user mentions "Perplexity", "AI search", or asks to search with citations.
What this skill does
## Troubleshooting
If requests fail, run `zero doctor check-connector --env-name PERPLEXITY_TOKEN` or `zero doctor check-connector --url https://api.perplexity.ai/chat/completions --method POST`
## How to Use
### 1. Chat Completions (Recommended)
AI-powered Q&A with web search and citations. OpenAI SDK compatible.
**Basic query with sonar model:**
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar",
"messages": [
{"role": "user", "content": "What is the current price of Bitcoin?"}
]
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
**With system prompt:**
Write to `/tmp/perplexity_request.json`:
```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:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
**Advanced query with sonar-pro:**
Write to `/tmp/perplexity_request.json`:
```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:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 2. Search with Domain Filter
Limit search to specific domains.
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Latest research on transformer architectures"}
],
"search_domain_filter": ["arxiv.org", "openai.com", "anthropic.com"]
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
**Exclude domains (add `-` prefix):**
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Best programming practices"}
],
"search_domain_filter": ["-reddit.com", "-quora.com"]
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 3. Search with Time Filter
Filter by recency.
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Major tech news"}
],
"search_recency_filter": "week"
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
**Filter by date range:**
Write to `/tmp/perplexity_request.json`:
```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:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 4. Academic Search
Search academic sources.
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar",
"messages": [
{"role": "user", "content": "Recent papers on large language model alignment"}
],
"search_mode": "academic"
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 5. Raw Search API
Get raw search results without AI synthesis.
Write to `/tmp/perplexity_request.json`:
```json
{
"query": "Claude AI Anthropic",
"max_results": 5
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
**With domain and time filters:**
Write to `/tmp/perplexity_request.json`:
```json
{
"query": "machine learning tutorials",
"max_results": 10,
"search_domain_filter": ["github.com", "medium.com"],
"search_recency_filter": "month",
"country": "US"
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/search" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 6. Deep Research (Long-form)
For comprehensive research reports.
Write to `/tmp/perplexity_request.json`:
```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:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
### 7. Reasoning Model
For complex problem-solving.
Write to `/tmp/perplexity_request.json`:
```json
{
"model": "sonar-reasoning-pro",
"messages": [
{"role": "user", "content": "Analyze the pros and cons of microservices vs monolithic architecture for a startup"}
]
}
```
Then run:
```bash
curl -s -X POST "https://api.perplexity.ai/chat/completions" --header "Authorization: Bearer $PERPLEXITY_TOKEN" --header "Content-Type: application/json" -d @/tmp/perplexity_request.json
```
## Models
| 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 |
## Response Format
Chat completions return:
```json
{
"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
}
}
```
## Guidelines
1. **Model Selection**: Use `sonar` for simple queries, `sonar-pro` for complex ones
2. **Cost Optimization**: Lower `search_context_size` reduces costs (low/medium/high)
3. **Domain Filters**: Limit to 20 domains max; use `-` prefix to exclude
4. **Recency Filters**: Options are `day`, `week`, `month`, `year`
5. **Temperature**: Lower (0.1-0.3) for factual queries, higher for creative
6. **Rate Limits**: Vary by tier; check https://docs.perplexity.ai/guides/rate-limits-usage-tiers
7. **Citations**: Response includes numbered citations `[1]` that map to `citations` array
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.