Microsoft Edge Prompt API Guide: Build On-Device AI Features in Websites

November 20, 2026 17 min read By Bejoy Naduvilathara Joy
Microsoft Edge Prompt API Guide: Build On-Device AI Features in Websites

What if a website could summarise text, generate responses or analyse user input without sending every request to an external AI service?

Microsoft Edge is moving towards that possibility with its built-in on-device AI capabilities. On November 19, 2026, Microsoft announced the general availability of its Aion Instruct model in Edge and introduced an origin trial that lets developers test the Prompt API on live websites.

This gives web developers an opportunity to experiment with browser-based AI features using JavaScript. Instead of sending every prompt to a cloud model, a website can ask a small language model running on the user’s device to process text locally.

The announcement is particularly interesting because Aion Instruct has 2.3 billion parameters and is designed for common text tasks, including summarisation, text generation, instruction following and structured outputs.

However, there is an important distinction: Aion Instruct is generally available as Edge’s built-in model, but the Prompt API is still experimental and available for live websites through an origin trial.

This guide explains how the API works, how to register a website, and how to build a simple text summarisation feature with JavaScript.

Quick Summary

  • Microsoft announced Aion Instruct and the Prompt API origin trial on November 19, 2026.
  • Aion Instruct is a 2.3-billion-parameter small language model built into Microsoft Edge.
  • The Prompt API lets websites interact with the browser’s on-device language model using JavaScript.
  • Developers can test the API on live websites through Microsoft’s origin trial.
  • The model is downloaded when a website or browser feature first needs it, provided the device meets the requirements.
  • Text can be processed locally without sending the prompt to a cloud AI service.
  • Developers must check API availability, model availability and device compatibility before using it.
  • The Decisions API is a separate experimental preview for structured text classification and scoring.

What Is the Microsoft Edge Prompt API?

The Microsoft Edge Prompt API is an experimental web API that allows websites and browser extensions to communicate with a small language model built into Edge.

Developers can use JavaScript to send instructions and text to the model and receive generated responses.

For example, imagine a documentation website containing lengthy technical explanations. Instead of sending the content to a third-party AI service, the website could use the Prompt API to generate a shorter explanation directly on the visitor’s device.

Other possible applications include:

  • Summarising articles and documents.
  • Generating short descriptions.
  • Rewriting user-provided text.
  • Analysing written feedback.
  • Creating structured responses.
  • Building simple text-based assistance features.

The important difference is where the model runs.

With a conventional cloud AI integration, the website sends a request to a remote service. The service processes the prompt and returns a response.

With the Edge Prompt API, the browser runs its built-in language model locally. Once the model has been downloaded, the inference process does not need a separate cloud AI request.

This does not mean every AI feature can run locally. Larger reasoning tasks, specialised knowledge retrieval and workloads requiring more powerful models may still need cloud infrastructure.

What Is Aion Instruct?

Aion Instruct is the small language model Microsoft Edge uses for its built-in Prompt API.

Microsoft announced its general availability in Edge on November 19, 2026. The model has 2.3 billion parameters and is designed for common text-based workloads.

Microsoft highlights several capabilities:

CapabilityWhat it means for developers
Text generationGenerate responses from user instructions
SummarisationProduce shorter versions of longer text
Instruction followingProcess text according to supplied directions
Structured outputsGenerate responses in predictable formats
Text synthesisCombine and produce useful written content

The smaller model size is important because browser-based AI needs to operate within the resources available on a user’s device.

Aion Instruct is designed to be smaller and faster than the previous Phi-4-mini model used in Edge’s on-device AI experiments. Microsoft says it can support a broader range of devices.

How Does the Model Reach the Browser?

Developers do not need to download Aion Instruct manually and host it on their own website.

Microsoft Edge manages the model download.

When a website or browser feature first needs an on-device model, Edge downloads the required model and runtime if the device meets the necessary conditions.

The model is then available for use by websites running in that browser. Microsoft describes this as a shared one-time download rather than requiring every website to download its own copy.

There are a few conditions to understand:

  • The device must meet the hardware and storage requirements.
  • The browser needs an appropriate network connection for the initial download.
  • Users can disable on-device AI in Edge settings.
  • Enterprise policies can prevent the model from downloading.
  • The model may be unavailable on unsupported devices.

This means a website should never assume that every visitor can use the Prompt API.

How to Register for the Microsoft Edge Prompt API Origin Trial

The Prompt API is not a universally available web standard. Microsoft is using an origin trial to let developers test it on live websites and collect feedback.

An origin trial allows a browser feature to be enabled for visitors to a registered website during a limited testing period.

You do not need every visitor to manually enable an experimental browser flag. Instead, the registered website includes a token that Edge recognises.

Here is how to get started.

Step 1: Open Microsoft Edge Origin Trials

Visit the Microsoft Edge Origin Trials registration page.

Look for the active Prompt API trial.

Make sure you select the Prompt API trial rather than a different experiment. Microsoft lists several experimental browser features, and each trial has its own registration and token.

Step 2: Register Your Website Domain

Select the Prompt API trial and follow the registration process.

You may be asked to sign in and accept the terms of participation.

Enter the origin you want to register.

For example:

https://example.com

You can register a specific subdomain or enable the token for the main domain and its subdomains, depending on your deployment requirements.

The registration is based on the website origin, not an individual page URL. A path such as /ai-demo is not registered separately.

Step 3: Generate and Copy the Origin Trial Token

After submitting the registration, Microsoft generates an origin trial token.

Copy it and keep it available for your website configuration.

Do not publish a token before checking that it belongs to the correct registered domain.

Step 4: Add the Token to Your Website

There are two documented ways to provide the token.

The first option is to add a meta tag inside the HTML document’s head:

<head>
  <meta charset="UTF-8">
  <meta
    http-equiv="origin-trial"
    content="YOUR_ORIGIN_TRIAL_TOKEN"
  >
  <title>On-Device AI Demo</title>
</head>

Replace YOUR_ORIGIN_TRIAL_TOKEN with the token generated during registration.

Alternatively, you can send the token through an HTTP response header:

Origin-Trial: YOUR_ORIGIN_TRIAL_TOKEN

Both approaches allow a compatible Edge browser to recognise the registered experiment when someone visits your website.

Step 5: Test the Website in Microsoft Edge

Open the registered website in a supported version of Microsoft Edge.

Check whether the Prompt API is available and whether the model can be loaded.

The model may need to download the first time it is requested. Your implementation should communicate that state to visitors rather than leaving them waiting without feedback.

Microsoft also provides a Prompt API playground where developers can experiment with prompts and inspect model responses.

Build a Text Summarisation Feature With the Prompt API

Now let’s use the API in a practical example.

The goal is simple: allow visitors to paste a paragraph into a text area, click a button and receive a shorter version of the text.

This example uses the general-purpose Prompt API. It asks the language model to summarise the supplied content rather than relying on a separate task-specific summarisation API.

Step 1: Create the HTML Interface

Create an HTML file with a text area, a button and an output section.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>On-Device Text Summariser</title>
</head>
<body>
  <main>
    <h1>On-Device Text Summariser</h1>

    <p>
      Enter some text and generate a shorter version
      using the Microsoft Edge Prompt API.
    </p>

    <textarea
      id="sourceText"
      rows="10"
      placeholder="Paste your text here..."
    ></textarea>

    <button id="summariseButton">
      Summarise Text
    </button>

    <p id="status" role="status" aria-live="polite"></p>

    <section>
      <h2>Summary</h2>
      <div id="summaryOutput"></div>
    </section>
  </main>

  <script src="app.js"></script>
</body>
</html>

The interface is deliberately simple. The important part is the JavaScript integration.

Step 2: Check Whether the Prompt API Is Available

Before creating a model session, check whether the browser exposes the LanguageModel object.

if (!("LanguageModel" in globalThis)) {
  console.log("Prompt API is not available.");
}

This prevents the application from assuming that every browser supports the experimental API.

If the object is unavailable, display a message explaining that the feature requires a compatible Microsoft Edge environment.

Step 3: Check Model Availability

The Prompt API provides an availability method that tells you whether the model can currently be used.

const availability = await LanguageModel.availability();

console.log(availability);

The availability result can be:

StatusMeaning
availableThe model is ready to use
downloadableThe model can be used but needs downloading
downloadingThe model is currently downloading
unavailableThe model cannot be used on this device or in this environment

This check is important because a browser may expose the API even when the device cannot run the model.

Step 4: Create a Model Session

Once the API is available, create a session.

const session = await LanguageModel.create();

Creating a session loads the language model into memory so that it can process prompts.

You can also monitor the initial model download:

const session = await LanguageModel.create({
  monitor: (monitor) => {
    monitor.addEventListener("downloadprogress", (event) => {
      const progress = (event.loaded / event.total) * 100;

      console.log(`Model download: ${progress.toFixed(1)}%`);
    });
  }
});

This is useful for building a better user experience. If the model is not already downloaded, your interface can show a loading message or progress indicator.

Step 5: Send a Summarisation Prompt

After creating the session, use session.prompt() to send instructions and the text that needs summarising.

const text = `
Modern web applications often contain large amounts of information.
Users may need to read lengthy articles, technical documentation,
or reports before finding the details that matter to them.
A summarisation feature can reduce the time required to understand
the main points while preserving the important information.
`;

const prompt = `
Summarise the following text in three concise bullet points.
Keep the main ideas and do not introduce information
that is not present in the original text.

Text:
${text}
`;

const summary = await session.prompt(prompt);

console.log(summary);

The browser returns the generated response as text.

You can then display that response in the website interface.

Step 6: Connect Everything Together

The following JavaScript brings the example together. It checks API availability, checks model availability, creates a session and generates the summary.

const button = document.getElementById("summariseButton");
const sourceText = document.getElementById("sourceText");
const status = document.getElementById("status");
const output = document.getElementById("summaryOutput");

button.addEventListener("click", async () => {
  const text = sourceText.value.trim();

  if (!text) {
    status.textContent = "Please enter some text first.";
    return;
  }

  if (!("LanguageModel" in globalThis)) {
    status.textContent =
      "The Prompt API is not available in this browser.";
    return;
  }

  button.disabled = true;
  output.textContent = "";

  let session;

  try {
    status.textContent = "Checking model availability...";

    const availability = await LanguageModel.availability();

    if (availability === "unavailable") {
      status.textContent =
        "The on-device AI model is unavailable on this device.";
      return;
    }

    status.textContent = "Preparing the on-device AI model...";

    session = await LanguageModel.create({
      monitor: (monitor) => {
        monitor.addEventListener("downloadprogress", (event) => {
          const percentage =
            (event.loaded / event.total) * 100;

          status.textContent =
            `Downloading model: ${percentage.toFixed(0)}%`;
        });
      }
    });

    status.textContent = "Generating summary...";

    const prompt = `
      Summarise the following text in three concise bullet points.
      Preserve the important information and do not invent facts.

      Text:
      ${text}
    `;

    const summary = await session.prompt(prompt);

    output.textContent = summary;
    status.textContent = "Summary generated successfully.";

  } catch (error) {
    console.error(error);

    status.textContent =
      "The summarisation request could not be completed.";

  } finally {
    if (session) {
      session.destroy();
    }

    button.disabled = false;
  }
});

The example uses textContent to display the generated result. This avoids interpreting model-generated content as HTML.

It also destroys the session when the task finishes, allowing the browser to release resources associated with that session.

For a production implementation, consider adding request cancellation, input limits, clearer download progress, and a cloud fallback where appropriate.

On-Device AI vs Cloud AI APIs

The biggest architectural decision is whether a website should run AI locally or send requests to a cloud provider.

Neither approach is suitable for every workload.

ConsiderationEdge Prompt APICloud AI API
Processing locationUser’s deviceRemote infrastructure
Network requirementInitial model download; local inference afterwardNetwork required for requests
Model managementManaged by EdgeManaged by the provider or application
Hardware dependencyDepends on device compatibilityDepends primarily on remote infrastructure
Privacy modelPrompt input stays on the deviceDepends on provider and application data handling
Model capabilitySmall language modelDepends on the selected cloud model
Cost structureNo per-request cloud inference chargeUsually usage-based or subscription-based
Browser compatibilityExperimental Edge supportAvailable across browsers when integrated normally
CustomisationLimited to available model and API optionsDepends on the selected provider

When On-Device AI Makes Sense

Consider browser-based inference when:

  • The task involves short text generation or summarisation.
  • The feature needs to work without sending text to a server.
  • You want to reduce repeated cloud inference requests.
  • Low network latency is important after the model is downloaded.
  • The application can operate within the capabilities of a small language model.

For example, a writing interface could use on-device AI to shorten a paragraph or generate a brief description.

When a Cloud AI API Is Better

Cloud inference is generally more suitable when:

  • The application needs a more capable reasoning model.
  • The task requires access to large external knowledge sources.
  • You need consistent model availability across different devices.
  • The application requires centralised model management.
  • The workload involves complex analysis or long-running AI operations.

A cloud service also gives developers more control over model selection, request handling and infrastructure, although it introduces server costs and data-transfer considerations.

Why a Hybrid Approach Can Be More Practical

You do not necessarily need to choose only one approach.

A website can use on-device inference when the browser supports it and the task is suitable. When the model is unavailable or the task requires more capability, the application can switch to a cloud service.

For example:

  1. A visitor opens a website with an AI summarisation feature.
  2. The application checks whether the Prompt API is available.
  3. If the model is available, the website processes the text locally.
  4. If the browser cannot run the model, the website offers an alternative.
  5. If the task requires advanced reasoning, the application can send it to a configured cloud service with appropriate user consent.

This approach gives developers more flexibility without making the browser’s experimental API a mandatory dependency.

Handling Unsupported Browsers and Devices

Feature detection is essential when working with experimental browser APIs.

A visitor may use Chrome, Firefox, Safari or an Edge installation that does not support the Prompt API. Even within Edge, hardware restrictions, storage availability and user settings can prevent the model from running.

Do not make the AI feature the only way to complete an important task.

A simple fallback can look like this:

async function checkPromptAPI() {
  if (!("LanguageModel" in globalThis)) {
    return {
      supported: false,
      reason: "API not available"
    };
  }

  try {
    const availability = await LanguageModel.availability();

    if (availability === "unavailable") {
      return {
        supported: false,
        reason: "Model unavailable"
      };
    }

    return {
      supported: true,
      availability
    };

  } catch (error) {
    return {
      supported: false,
      reason: "Availability check failed"
    };
  }
}

Your interface can use the result to decide what to display.

For example:

  • Show the AI feature when the API and model are available.
  • Display a preparation message when the model needs downloading.
  • Offer a cloud-based alternative when local inference is unavailable.
  • Keep the original text-editing or summarisation workflow usable without AI.

Also account for users who disable on-device AI in Edge settings. A website should respect that choice rather than repeatedly attempting to initialise the model.

What Is the Experimental Decisions API?

Alongside the Prompt API origin trial, Microsoft announced a developer preview of the Decisions API.

It is a separate experiment powered by Aion Instruct, designed for structured decisions about text.

The Prompt API generates text in response to instructions. The Decisions API instead evaluates text against defined questions and returns structured results.

Microsoft’s announcement describes three question types:

Question typePurpose
BooleanAnswer a yes-or-no question
ChoiceSelect from predefined options
ScoreAssign a score based on a question

For example, an online store could use the Decisions API to analyse customer reviews.

It might determine:

  • Whether the review is mainly about product quality, delivery or price.
  • How satisfied the customer appears to be.
  • Whether the customer is requesting support.

Microsoft demonstrated the following JavaScript approach:

const model = await DecisionModel.create({
  context: "Customer reviews for an online electronics store",
  questions: [
    {
      id: "topic",
      type: "choice",
      prompt: "What is the review mainly about?",
      options: [
        {
          label: "quality",
          description: "How the product works or feels"
        },
        {
          label: "shipping",
          description: "Delivery, packaging, or delays"
        },
        {
          label: "price",
          description: "Cost or value for money"
        }
      ]
    },
    {
      id: "rating",
      type: "score",
      prompt: "How satisfied is the customer, from 1 to 5?"
    },
    {
      id: "needs_reply",
      type: "boolean",
      prompt: "Is the customer asking for help?"
    }
  ]
});

const result = await model.decide(
  "Love the headphones, but the box arrived crushed. Can I get a replacement?"
);

The result provides labels, probabilities and confidence information for the defined questions.

This makes the Decisions API interesting for text classification, customer feedback routing and lightweight content analysis.

However, it is currently a developer preview in Edge Canary and Dev channels. It is not the same API as the Prompt API origin trial, and developers should expect its design and implementation to change.

Important Limitations Developers Should Understand

On-device AI creates new possibilities, but it also introduces practical constraints.

1. The Prompt API is experimental

The API is available for testing through an origin trial. It is not a universally supported web standard, and its behaviour or availability can change.

2. The first model download takes time

Aion Instruct is downloaded when it is first needed. The initial experience may be slower than later requests, so show visitors a meaningful loading state.

3. Not every device qualifies

Hardware, operating system, available storage and network conditions affect whether Edge can download and run the model.

4. Users can disable on-device AI

Edge allows users to turn off on-device AI. Enterprise policies can also block model downloads.

5. Small models have capability limits

Aion Instruct is designed for common text tasks. It should not be treated as a replacement for larger reasoning models or specialised AI services.

6. Model output still requires validation

The model can produce inaccurate or unsuitable responses. Do not treat generated text as verified information, especially when processing customer data or making decisions.

7. Origin trial tokens expire

Origin trials are temporary. Developers should monitor the trial’s expiry date and renew the token when necessary. The experiment may also end earlier than planned.

8. Generated text may contain an invisible watermark

Microsoft’s updated Prompt API documentation notes that text generated through the API includes an invisible AI-generated-content watermark in Edge 158 and later. Developers should account for this when rendering, parsing or converting generated responses.

Final Thoughts

The Microsoft Edge Prompt API gives web developers another way to introduce AI features without building every integration around a remote model.

With Aion Instruct now available as Edge’s built-in small language model, developers can experiment with text generation, summarisation and other lightweight tasks directly inside the browser.

The most interesting part is not simply that a browser can run an AI model. It is the possibility of treating on-device inference as another capability available to a website, alongside JavaScript, storage and other browser APIs.

There are still important limitations. The Prompt API is experimental, device support is restricted, and the origin trial is intended for testing rather than guaranteed long-term production availability.

For developers, the sensible approach is to experiment with a focused feature, measure its performance on supported devices and provide a reliable fallback for everyone else.

On-device AI is not going to replace every cloud AI integration. But it gives web applications another option—and that is worth exploring.

Stay tuned to Pixoptimo as we bring you the latest insights on design, development, tools, and the technology shaping the web.