# AI Inside the Browser: The Prompt API With Gemini Nano
Table of Contents
Almost every “smart” feature we use online - an automatic summary, a writing suggestion, an answer to a question - works the same way. The text leaves the device, travels to a server, gets processed by an AI model, and comes back. It’s convenient, but it has three costs: the data leaves the device, there’s a wait for the round trip, and every request costs money for whoever runs the service. Chrome’s Prompt API tries to change that pattern. It brings the model inside the browser, onto the computer of the person browsing, so the work happens locally, without calling the cloud.
What the Prompt API is
An API (application programming interface) is an agreed set of instructions that lets one program ask another for a service. So the Prompt API is the way a web page’s or an extension’s code can send a request to an AI model already built into Chrome.
In plain terms: you write the request the way you’d write it to an assistant (“summarize this text”, “extract the name and email from this message”, “is this review positive or negative?”) and the model answers. The word prompt is exactly that natural-language request.
The model doing the answering is called Gemini Nano. It’s a compact version of Google’s Gemini models, designed to run on an ordinary device rather than in a data center. One important detail: the model isn’t shipped inside the browser. It’s downloaded separately the first time a site or extension uses it, then it stays on the device, and later requests don’t repeat the download.
What it lets you do
The Prompt API is general-purpose: it isn’t tied to a single task. According to Chrome’s documentation, the model can handle text reasoning and generation, classification, and content extraction and analysis. In practice that lines up with the jobs that come up most often on a page:
- Summarize a long article or a message thread down to a few lines.
- Classify a piece of text - for example, sorting requests into “urgent” and “not urgent”, or gauging the tone of a comment.
- Extract structured information from free text: a date and place from an invitation, a contact from an email signature.
- Rewrite or generate short text from instructions.
A less obvious point: the Prompt API doesn’t only accept text. The documentation notes it can also take images and audio as input. That opens up cases like describing the content of an image or transcribing a voice note - again, locally.
For the most common tasks there are also dedicated APIs that are simpler to use because they’re already specialized: among them the Summarizer, the Translator, the Language Detector, plus Writer, Rewriter, and Proofreader for writing, rewriting, and correcting. They belong to the same family of AI features built into the browser, an approach not unlike the way Agent Skills package specific procedures for AI assistants.
Why it matters: privacy, latency, cost
The reason this is worth attention isn’t “there’s AI in the browser” - it’s where the computation happens.
Privacy. If the model runs on the device, the text (or image) to be processed doesn’t have to be sent to an outside server. For sensitive content - personal notes, unpublished drafts, private messages - that’s a real difference: the data never leaves the computer, which also matters for GDPR compliance.
Latency. Without the trip out to the cloud and back, the answer can arrive sooner. And once the model is downloaded, many requests can even work offline, which is impossible when every operation depends on a remote server.
Cost. Every call to a cloud model has a price for whoever builds the service. With local processing, that per-request cost isn’t there: the work uses the device of the person browsing. For features used often, the difference on the final bill is real.
None of these benefits kills off the cloud. The large models running in data centers are still more capable. The point is having a choice: for simple, frequent tasks, the local option is often enough.
The status: what’s ready and what isn’t
Here honesty is needed, because the status isn’t uniform.
For Chrome extensions, the Prompt API has reached a stable release: extension developers can use it in production. The path started with an origin trial (a public testing phase open to those who sign up) that began with Chrome 131, and it later became available in a stable form.
On regular web pages, the situation is earlier-stage: access goes through an origin trial or a flag you enable by hand. In short, on the open web it’s still an evolving technology, not something to build on without a fallback.
There are also concrete requirements that limit availability. The documentation points to desktop devices (Windows 10 or 11, macOS 13 and later, Linux; on ChromeOS only Chromebook Plus) and not Chrome on Android or iOS. It calls for free disk space (the docs cite around 22 GB) and a graphics card with more than 4 GB of dedicated memory, or enough RAM and CPU cores. Translation: not every visitor has a suitable device, and that has to be planned for.
A minimal example
The code below shows the basic pattern: first check whether the model is available, then create a session and send the request.
// 1. Check whether the model is usable on this deviceconst status = await LanguageModel.availability();
if (status !== "unavailable") { // 2. Create a session (may download the model on first use) const session = await LanguageModel.create();
// 3. Send a request and wait for the complete answer const answer = await session.prompt( "Summarize in one sentence: " + text );
// 4. Free the resources when you're done session.destroy();}There’s also promptStreaming(), which returns the answer piece by piece as it’s generated - handy for showing something to the user right away on longer text.
Limits to keep in mind
- It’s a small model. Gemini Nano is less capable than the large cloud models. It does well on well-defined tasks (summarizing, classifying, extracting), less so on complex reasoning or very specific knowledge.
- It can be wrong. Like any model of this kind, it sometimes produces incorrect or made-up answers. Treat the output as a draft, not as truth to use as-is for important decisions.
- Availability varies. Always check with
availability()before using the API, and plan an alternative (a cloud service, or a manual flow) for people without a suitable device. - On the web it’s still moving. The interface can change during the trial phase. On the open web it’s worth experimenting, but not yet depending on it for critical features.
In short
The Prompt API lets a page’s or an extension’s code talk to Gemini Nano, an AI model that runs inside Chrome, on the device. It’s for summarizing, classifying, extracting, and generating text - and for images and audio too - without sending the data to the cloud. The benefits are clear: more privacy, less waiting, no per-request cost. The status, though, needs reading carefully: stable for extensions, still experimental on web pages, with device requirements that rule out a share of users. It isn’t the end of the cloud, but one more option: bringing the AI to where the data is, instead of shipping the data to where the AI is.
