AI-powered query autocomplete suggestions for Perplexity.ai, built using the Perplexity Sonar API.
As you type in Perplexity's search bar, this extension shows 5 AI-generated query suggestions in a native-looking dropdown — similar to Google's autocomplete, but powered by Perplexity's own model.
- 350ms debounce — suggestions appear without lag
- Keyboard navigation (
↑↓to navigate,Enterto select,Escto dismiss) - Styled to match Perplexity's dark UI
- Your API key is stored locally — never sent anywhere except the Perplexity API
- Google Chrome (or any Chromium-based browser: Brave, Arc, Edge)
- A Perplexity API key (free tier available)
Clone or download this repository:
git clone https://github.com/ravisastryk/perplexity-autocomplete.gitOr click Code → Download ZIP on GitHub and extract the folder.
- Open Chrome and go to:
chrome://extensions - Toggle Developer mode ON (top-right corner)
- Click "Load unpacked"
- Select the
perplexity-autocompletefolder
The extension icon will appear in your Chrome toolbar.
- Click the extension icon in the toolbar
- Paste your Perplexity API key (starts with
pplx-) - Click Save API Key
Get your API key: Go to perplexity.ai/settings/api → Create a key
- Open perplexity.ai
- Start typing in the search bar (at least 3 characters)
- Suggestions appear after ~350ms
perplexity-autocomplete/
├── manifest.json # Chrome extension config (Manifest V3)
├── background.js # Service worker — calls Perplexity Sonar API
├── content.js # Injected into perplexity.ai — renders dropdown
├── styles.css # Dropdown UI styles
├── popup.html # Extension popup UI (API key input)
├── popup.js # Popup logic
└── README.md # You are here
User types in search bar
↓
content.js detects input (debounced 350ms)
↓
Sends message to background.js
↓
background.js calls Perplexity Sonar API
→ prompt: "return 5 autocomplete suggestions as JSON array"
↓
Suggestions returned and rendered in dropdown
↓
User clicks or presses Enter → query is applied
This extension uses the sonar model (Perplexity's most affordable).
| Usage | Estimated Cost |
|---|---|
| 100 searches/day | ~$0.01–0.05/day |
| 1,000 searches/day | ~$0.10–0.50/day |
Costs are minimal due to the 350ms debounce (prevents excessive calls while typing).
In background.js, find this line:
model: "sonar",And change to sonar-pro for higher quality suggestions (slightly higher cost).
In content.js, find:
}, 350); // Debounce delay in msIncrease for fewer API calls, decrease for faster suggestions.
In background.js, update the system prompt:
return exactly 5 complete ...
Change 5 to any number between 3–8.
MIT — free to use, modify, and distribute.
| Issue | Fix |
|---|---|
| No suggestions appearing | Check API key is saved and starts with pplx- |
| "API request failed" | Verify your API key has credits at perplexity.ai/settings/api |
| Dropdown not showing | Reload the Perplexity tab after installing extension |
| Extension not loading | Make sure Developer Mode is ON in chrome://extensions |