Back to blog

Tutorial

Microsoft Edge Prompt API Explained: On-Device AI, Browser Integration and Use Cases

OleToken Blog · 8 min read · November 23, 2026

The Microsoft Edge Prompt API lets websites and browser extensions use a language model supplied by the browser. For developers, the appeal is straightforward: selected text tasks can run on the user's device without sending each prompt to a cloud inference service.

That does not mean every Edge visitor can immediately use it. The API is experimental, model availability depends on settings and hardware, and applications need a fallback. This guide uses Microsoft documentation checked on November 23, 2026 and explains the current model, access process, practical integration, and operational limits.

What is the Microsoft Edge Prompt API?

The Prompt API is a general-purpose browser AI API for generating and analyzing text from JavaScript. A website creates a model session, submits a prompt, receives generated text, and releases resources when finished. Extensions can use the same broad interaction pattern.

Microsoft documents the API as a developer preview. Developers can test it locally or enable it for a live website through an origin trial. An origin trial is a controlled experiment with registration and a limited period of availability, not evidence of permanent support across every browser.

Related Edge APIs focus on specific tasks such as writing assistance, classification, proofreading, language detection, and translation. Choose the most suitable documented interface for your use case rather than automatically implementing every feature through a general prompt.

Which model runs on the device?

The checked Edge documentation identifies Aion Instruct, a 2.3-billion-parameter small language model, as the model behind the Prompt API. This is important because older tutorials may name a different model. Treat browser documentation and runtime behavior as the current integration baseline.

A small model can be useful for bounded text tasks, but parameter count alone does not establish accuracy. Test the languages, document lengths, and instructions your product requires. Do not assume the model will perform like a much larger cloud model on complex reasoning or specialized professional questions.

Microsoft notes that the model can produce unreliable, inaccurate, unfair, or offensive outputs. Application validation remains necessary. On-device execution changes where inference happens; it does not eliminate hallucinations or make generated answers suitable for automatic high-impact decisions.

Hardware, downloads, and availability

The documented operating-system requirements include Windows 10 or 11, macOS 13.3 or later, and 64-bit Linux with Vulkan GPU drivers and Edge 159 or later. Local testing instructions otherwise specify Edge 158 or later. Always check requirements for the exact platform you support.

Microsoft lists at least 20 GB of available storage on the volume containing the Edge profile and at least 3 GB of GPU VRAM. The 20 GB figure is an available-space requirement, not a statement that the model download itself is 20 GB. If free storage drops below 5 GB, the model can be deleted.

The initial download requires an unlimited data plan or an unmetered connection. Enterprise policies, a disabled On-device AI setting, or unsupported hardware can prevent availability. This means even an otherwise compatible browser version may not provide a usable local model.

In Canary, Dev, and Beta channels, the On-device AI option has additional default-setting considerations. Follow Microsoft's current setup instructions and use runtime checks. Do not tell users to change security or organizational policies merely to make an optional enhancement work.

Browser integration: a dependable lifecycle

Check the API and model separately

First test whether the browser exposes LanguageModel. Then call LanguageModel.availability() when supported. The documented results distinguish unavailable, downloadable, downloading, and available states. Presence of the JavaScript interface alone does not prove inference can start immediately.

Your interface should explain when a download is required and provide a useful alternative. A text box that silently waits for a large model download creates a confusing experience. Preserve the user's work while changing between local, downloading, and fallback states.

Create and manage a session

Use LanguageModel.create() to load the model and create a session. The documented monitor option exposes download progress. Initial prompts can supply system instructions and examples, helping establish the desired output pattern before user requests arrive.

Use session.prompt() when the application needs a completed response and session.promptStreaming() when incremental text improves the experience. Microsoft documents abort signals for stopping generation. Offer a visible stop control for tasks that may take noticeable time.

Call session.destroy() when the session is no longer needed. A well-designed application does not leave resources occupied after a panel closes. Treat session cleanup as part of normal navigation and component disposal, not only as an error-recovery task.

Validate structured output and generated text

The API supports output constraints through a JSON schema or regular expression. These can help shape a response, but application code should still parse and validate the result. Enforce allowed categories and required fields before generated values affect business logic.

Starting with Edge 158, Microsoft documents an invisible watermark in generated Prompt API text. Responses generated with the response-constraint option are exempt under the checked documentation. Account for this when comparing strings, converting formats, or processing output, and review applicable content-marking requirements.

On-device privacy and network behavior

Microsoft states that Prompt API model inputs remain on the device and are not collected to train models. After the initial download, prompting does not require cloud inference, making offline operation possible when the model is available.

Your application can still send data elsewhere through analytics, error reporting, synchronization, or a cloud fallback. Document those behaviors separately. A product should not claim that all user content stays local if its own code uploads the prompt after a local failure.

Retrieved pages, user documents, and copied text can contain malicious instructions. Keep untrusted content separate from application rules, restrict privileged actions, and validate outputs. Local inference does not protect against prompt injection by itself.

Practical use cases for browser AI

Draft assistance and bounded classification

A writing panel can offer a shorter version of a paragraph while retaining the original for comparison. A support form can suggest a category from a fixed list. A browser extension can help organize selected text after an explicit user action.

For each task, define success narrowly. A category suggestion should not automatically submit a ticket to an external system. A rewritten paragraph should remain editable. Users need a way to reject or correct the model's output without losing their source content.

Local-first workflows with optional cloud support

A useful architecture attempts an eligible local task, checks the result, and offers cloud processing when a stronger model or unavailable device requires it. Obtain the appropriate user choice before sending text off-device, especially when the interface emphasizes local processing.

OLEToken can provide a unified AI API integration for supported cloud models in this fallback layer. Keep cloud credentials on your backend rather than embedding a long-lived key in browser JavaScript. Confirm the selected model, pricing, data terms, and compatibility independently.

Cost and performance: measure the whole experience

The built-in Prompt API avoids per-request cloud inference fees for local execution. However, users still consume storage, memory, power, and download bandwidth, while developers maintain integration and support. Describe it as avoiding cloud inference charges rather than promising a cost-free application.

For a hypothetical service making 100,000 cloud calls at $0.002 each, the inference component would be $200. Moving suitable calls locally could reduce that component, but only after accounting for the share of supported devices, fallback calls, and quality requirements. Those numbers are illustrative assumptions, not Microsoft prices.

Benchmark startup, download completion, time to first output, total latency, cancellation, and browser responsiveness. Include low-battery devices and realistic concurrent tabs. Report results by device class instead of presenting one powerful workstation as representative of the entire audience.

FAQ

Is the Edge Prompt API generally available?

The checked documentation calls it a developer preview, available for local testing and live-site experimentation through an origin trial.

Does it currently use Aion Instruct?

Yes. Microsoft identifies the 2.3-billion-parameter Aion Instruct model in the checked Prompt API documentation.

Can it work offline?

Local prompting can work without network inference after the model is downloaded and available. Initial setup and your application's other services may still require connectivity.

Can I remove the cloud fallback?

You can design a local-only feature, but unsupported devices then need a clear unavailable state or a non-AI alternative. Test that experience deliberately.

References and next step

Use Microsoft's Prompt API documentation as the implementation reference and recheck preview requirements before release.

If your application needs optional cloud inference, review OLEToken and make the transition between local and cloud processing explicit to users.