How to Set Up a DeepSeek Chrome Extension with V4 (Step-by-Step)
Want DeepSeek answers next to your browser tab without copy-pasting into a chat window? A DeepSeek Chrome extension does exactly that — it pipes selected text, page summaries, or freeform questions into the DeepSeek API and shows the response inline. The catch is that there is no single “official” DeepSeek extension in the Chrome Web Store; you choose between community extensions that accept a DeepSeek API key, or you build a minimal one yourself in about 80 lines of code.
This tutorial walks through both routes using the current DeepSeek V4 models released April 24, 2026. By the end, you will have a working sidebar that calls `deepseek-v4-flash` (or `deepseek-v4-pro`) on selected text, with cost estimates and the common errors mapped out.
What you’ll build
You will end this tutorial with a Chrome extension that opens a side panel, takes a prompt or the currently selected text on a webpage, and returns a response from the DeepSeek API. The extension stores your API key locally in chrome.storage.local, sends requests to the OpenAI-compatible endpoint POST /chat/completions, and supports both the cost-efficient deepseek-v4-flash and the frontier-tier deepseek-v4-pro model IDs.
Two paths are covered:
- Path A — Install a community extension from the Chrome Web Store and paste in your API key. Fastest, but you trust someone else’s code with your key.
- Path B — Build your own minimal extension using Manifest V3. Takes 15–20 minutes, gives you full control, and can be loaded unpacked from a local folder.
Both paths target the same API surface, so the request/response logic is identical. If you are new to the API itself, the DeepSeek API getting started guide covers authentication and your first request before you wire it into a browser.
Prerequisites
- Google Chrome 120+ (or any Chromium browser supporting Manifest V3 — Edge, Brave, Arc).
- A DeepSeek account and an API key. If you don’t have one, follow the get a DeepSeek API key walkthrough.
- A funded balance on the DeepSeek billing console. Even a $2 top-up is enough for thousands of test calls on V4-Flash.
- For Path B only: a text editor (VS Code is fine) and basic familiarity with JavaScript and JSON.
Why a Chrome extension instead of the web app?
The DeepSeek web chat at chat.deepseek.com is fully functional and maintains conversation history across turns. A browser extension wins on three specific workflows:
- In-context selection. Highlight a paragraph in any tab and send it to DeepSeek without switching windows.
- Page-aware prompts. Ask “summarise this article” or “extract the key claims” with the page’s text injected automatically.
- Model and parameter control. Pick V4-Flash for routine work, V4-Pro for harder reasoning, set
temperatureper task, and toggle thinking mode — none of which the web UI exposes the same way.
The trade-off: the API is stateless. Unlike the web chat, the extension must resend the conversation history with every request. For a deeper read on the difference, see DeepSeek browser vs app.
Path A: Install a community extension
Several third-party extensions in the Chrome Web Store accept a DeepSeek API key. Search for “DeepSeek” or “AI sidebar” and look for these signals before installing:
- Open-source, with a linked GitHub repo you can read.
- API key stored locally in
chrome.storage.local, never sent to a third-party server. - Recent updates (within the last 90 days) and a non-trivial install count.
- Manifest V3 — Manifest V2 extensions are deprecated and will stop working.
Configure the extension
After install, open the extension’s options page and:
- Paste your API key from the DeepSeek console.
- Set the base URL to
https://api.deepseek.com(orhttps://api.deepseek.com/v1if the extension expects the OpenAI path). - Set the model to
deepseek-v4-flashfor general use. - If thinking mode is exposed, leave it off for everyday prompts and enable it only for harder reasoning tasks.
If the extension still references legacy IDs like deepseek-chat or deepseek-reasoner, those continue to work — they currently route to deepseek-v4-flash — but they will be retired on 2026-07-24 at 15:59 UTC. Switch to the V4 IDs while you have the chance; migration is a one-line model= swap and the base_url does not change.
Path B: Build your own minimal extension
This is the route I recommend if you care about what your API key touches. The extension below is a complete Manifest V3 build with three files: manifest.json, sidepanel.html, and sidepanel.js.
Step 1: Create the project folder
Make a directory called deepseek-sidepanel with these three files inside.
Step 2: Write the manifest
Create manifest.json with the following JSON. The host_permissions entry is what allows fetch calls to the DeepSeek API from inside the extension.
{
"manifest_version": 3,
"name": "DeepSeek Side Panel",
"version": "1.0.0",
"description": "Send selected text to DeepSeek V4.",
"permissions": ["sidePanel", "storage", "activeTab", "scripting"],
"host_permissions": ["https://api.deepseek.com/*"],
"action": { "default_title": "Open DeepSeek panel" },
"side_panel": { "default_path": "sidepanel.html" },
"background": {
"service_worker": "background.js"
}
}
Step 3: Write the side panel HTML
Create sidepanel.html. This is the visible UI: a key field, a model picker, a prompt box, and a response area.
<!doctype html>
<html>
<body>
<input id="key" type="password" placeholder="DeepSeek API key" />
<select id="model">
<option value="deepseek-v4-flash">V4-Flash (cheap)</option>
<option value="deepseek-v4-pro">V4-Pro (frontier)</option>
</select>
<label><input id="think" type="checkbox" /> Thinking mode</label>
<textarea id="prompt" rows="6"></textarea>
<button id="send">Send</button>
<pre id="out"></pre>
<script src="sidepanel.js"></script>
</body>
</html>
Step 4: Write the side panel JavaScript
Create sidepanel.js. This file builds the request body, calls POST /chat/completions, and renders the response. The OpenAI SDK pattern works identically here using plain fetch.
const $ = (id) => document.getElementById(id);
chrome.storage.local.get("key", (r) => { if (r.key) $("key").value = r.key; });
$("key").addEventListener("change", (e) =>
chrome.storage.local.set({ key: e.target.value })
);
$("send").addEventListener("click", async () => {
const body = {
model: $("model").value,
messages: [{ role: "user", content: $("prompt").value }],
temperature: 1.3,
max_tokens: 2048,
stream: false
};
if ($("think").checked) {
body.reasoning_effort = "high";
body.thinking = { type: "enabled" };
}
const res = await fetch("https://api.deepseek.com/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + $("key").value
},
body: JSON.stringify(body)
});
const data = await res.json();
$("out").textContent = data.choices?.[0]?.message?.content ?? JSON.stringify(data, null, 2);
});
A small background.js service worker is needed to open the panel when the toolbar icon is clicked:
chrome.action.onClicked.addListener((tab) =>
chrome.sidePanel.open({ windowId: tab.windowId })
);
Step 5: Load the extension in Chrome
- Open
chrome://extensions. - Toggle Developer mode on (top-right).
- Click Load unpacked and select your
deepseek-sidepanelfolder. - Pin the extension to the toolbar.
Verify it worked
Click the toolbar icon to open the side panel, paste your API key, leave the model on deepseek-v4-flash, and type “Reply with the single word PONG.” Click Send. You should see PONG in the response area within 1–2 seconds.
If thinking mode is enabled, the response object also contains reasoning_content alongside the final content. The minimal extension above only renders content; extending it to show the reasoning trace is a five-line change.
Cost: what does this actually run?
API pricing as of April 2026, per the official DeepSeek pricing page:
| Model | Input cache hit | Input cache miss | Output |
|---|---|---|---|
| deepseek-v4-flash | $0.028 / 1M | $0.14 / 1M | $0.28 / 1M |
| deepseek-v4-pro | $0.145 / 1M | $1.74 / 1M | $3.48 / 1M |
A realistic Chrome-extension workload — say 200 prompts a day, each with a 500-token system prompt (cached), a 300-token user message, and a 600-token reply — costs the following on deepseek-v4-flash:
- Cached input: 500 × 200 = 100,000 tokens × $0.028/M = $0.0028
- Uncached input: 300 × 200 = 60,000 tokens × $0.14/M = $0.0084
- Output: 600 × 200 = 120,000 tokens × $0.28/M = $0.0336
- Daily total: about $0.045 — roughly $1.35 a month.
The same workload on deepseek-v4-pro runs about $0.45 a day, or $13.50 a month — roughly 10× the spend, justified only when V4-Flash is genuinely failing on the task. For a richer estimator, the DeepSeek pricing calculator handles mixed workloads.
Off-peak discounts that existed under V3 and earlier ended on 2025-09-05 and have not been reintroduced for V4. Don’t budget around them.
Recommended parameters per task
DeepSeek’s official temperature guidance is worth coding directly into your extension’s UI as presets:
| Task type | Temperature | Notes |
|---|---|---|
| Code generation, math | 0.0 | Deterministic; pair with V4-Pro for hard problems |
| Data analysis, cleaning | 1.0 | Balanced; V4-Flash is fine |
| General chat, translation | 1.3 | Default for the side panel above |
| Creative writing, poetry | 1.5 | Looser sampling |
Other parameters worth surfacing in a Chrome extension UI: top_p for nucleus sampling, max_tokens (V4 supports up to 384,000 output tokens against a 1,000,000-token context window), stream for token-by-token rendering, and response_format={"type": "json_object"} for JSON mode. JSON mode is designed to return valid JSON — not guaranteed — so always include the word “json” in your prompt with a small example schema, and set max_tokens high enough that the output cannot be truncated mid-object.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 Unauthorized | Bad or missing API key | Re-paste the key; check it has no leading/trailing spaces |
| 402 Payment Required | Zero balance | Top up in the billing console |
| 429 Too Many Requests | Rate limit hit | Add a small backoff; see the DeepSeek API rate limits reference |
| CORS error in console | host_permissions missing |
Confirm https://api.deepseek.com/* in manifest.json |
| Empty response, JSON mode | Documented edge case | Re-prompt; raise max_tokens; include “json” + schema in prompt |
| Truncated thinking output | max_tokens too low |
For thinking-max, set max_tokens ≥ 384,000 capacity |
| Model ID rejected | Typo or retired ID after 2026-07-24 | Use deepseek-v4-flash or deepseek-v4-pro |
Security notes
Three things worth doing before you trust any extension — including your own — with an API key:
- Never hardcode the key in the source. The extension above stores it via
chrome.storage.local, which keeps it on the local machine and out of the codebase. - Restrict
host_permissionsto the DeepSeek domain only. A wildcard like<all_urls>is overkill and a red flag in any third-party extension you install. - Rotate the key if you publish or share the extension folder. The DeepSeek console allows revocation and re-issue at any time.
Next steps
The side panel above is intentionally minimal. Sensible upgrades, in order of usefulness:
- Streaming. Switch
stream: trueand parse server-sent events for token-by-token rendering. The DeepSeek API streaming guide covers the SSE format. - Selected-text capture. Add a content script that reads
window.getSelection()and pre-fills the prompt box. - Conversation history. Maintain a
messagesarray inchrome.storage.localso multi-turn chat works — remember the API itself is stateless. - Context caching. Keep the system prompt at the start of every
messagesarray so DeepSeek’s automatic prefix cache kicks in and you pay the cache-hit rate. See the DeepSeek context caching reference.
If you want a different surface for the same model, the DeepSeek with VS Code tutorial wires V4 into an editor instead of a browser, and the broader DeepSeek tutorials hub catalogues every integration on the site.
Last verified: 2026-04-25. DeepSeek AI Guide is an independent resource and is not affiliated with DeepSeek or its parent company. Model IDs, pricing and API behaviour change; check the official DeepSeek documentation and pricing page before committing to a production decision.
Is there an official DeepSeek Chrome extension?
No. DeepSeek publishes web chat at chat.deepseek.com, mobile apps, and the API, but does not ship a first-party browser extension as of April 2026. The Chrome Web Store hosts community-built extensions that accept a DeepSeek API key. Verify any extension is open-source, recently updated, and uses Manifest V3 before pasting in a key. For a vetted starting point, see verify official DeepSeek app.
How much does a DeepSeek Chrome extension cost to run?
Extension code is free; you only pay DeepSeek API rates. On deepseek-v4-flash, 200 prompts a day with modest token sizes runs about $1.35 a month. On deepseek-v4-pro, the same load is closer to $13.50. Top up a small balance in the DeepSeek billing console and watch usage. The DeepSeek API pricing page lists the current per-million-token rates.
Can I use the legacy deepseek-chat model ID in the extension?
Yes, until 2026-07-24 at 15:59 UTC. Until that retirement date, deepseek-chat and deepseek-reasoner route to deepseek-v4-flash in non-thinking and thinking modes respectively. After that, requests using legacy IDs will fail. Switching is a one-line model= swap; the base_url stays the same. The DeepSeek OpenAI SDK compatibility reference covers the migration.
Does the Chrome extension keep my conversation history?
Only if you build it to. The DeepSeek API is stateless — the server does not remember prior turns, so the client must resend the full messages array every request. The web chat at chat.deepseek.com keeps history server-side; an extension does not unless it stores messages locally. The DeepSeek browser vs app guide explains this difference.
What’s the difference between V4-Flash and V4-Pro in a browser extension?
deepseek-v4-flash (284B total / 13B active parameters) handles routine summarisation, translation, and chat at low cost. deepseek-v4-pro (1.6T / 49B active) is the frontier-tier model for harder coding and reasoning at roughly 12× the output rate. Both share a 1,000,000-token context window and support thinking mode. Start with Flash; promote to Pro only when Flash fails. Compare them in detail in the DeepSeek V4 overview.
