Get started with built-in AI

AI_USAGE=false

Published: December 12, 2024, Last updated: May 20, 2025

With built-in AI APIs, your web application can perform AI-powered tasks without needing to deploy or manage its own AI models. We are working to standardize these APIs across browsers.

Requirements

To use built-in AI, there are model and hardware requirements.

Models

The Prompt API, Summarizer API, Writer API, and Rewriter API download a large language model that is designed to run locally on desktop and laptop computers. These APIs don't work on mobile devices. Before you use these API, acknowledge Google's Generative AI Prohibited Uses Policy.

The Summarizer API, Writer API, and Rewriter API only support text-to-text modality. The Prompt API has multimodal capabilities available for local prototyping to Early Preview Program Participants.

Hardware

The following requirements exist for developers and the users who operate features using these APIs in Chrome. Other browsers may have different operating requirements.

The Language Detector and Translator APIs work in Chrome on desktop. These APIs do not work on mobile devices. The Prompt API, Summarizer API, Writer API, and Rewriter API work in Chrome when the following conditions are met:

  • Operating system: Windows 10 or 11; macOS 13+ (Ventura and onwards); or Linux. Chrome for Android, iOS, and ChromeOS are not yet supported by the APIs which use Gemini Nano.
  • Storage: At least 22 GB of free space on the volume that contains your Chrome profile.
  • GPU: Strictly more than 4 GB of VRAM.
  • Network: Unlimited data or an unmetered connection.

Gemini Nano's exact size may vary as the browser updates the model. To determine the current size, visit chrome://on-device-internals and go to Model status. Open the listed File path to determine the model size.

Start building

There are several built-in AI APIs available at different stages of development. Some are in Chrome stable, some are available participants of origin trials, and others are only available to Early Preview Program participants.

Each API has its own set of instructions to get started and download the model, both for local prototyping and in production environments with the origin trials.

All of these APIs can be used when building Chrome Extensions.

Model download

APIs are built into Chrome, as are the models. The first time a user interacts with these APIs, the model must be downloaded to the browser.

To determine if an API is usable and ready, call the asynchronous availability() function, which returns a promise with one of the following values:

  • "unavailable": The user's device or requested session options are not supported. The device may have insufficient power or disk space.
  • "downloadable": Additional downloads are needed to create a session, which may include an expert model, a language model, or fine-tuning. User activation may be required to call create().
  • "downloading": Downloads are ongoing and must complete before you can use a a session.
  • "available": You can create a session immediately.

User activation

A user interaction is required to download the requisite models and configurations to the browser. If your website or web application is a user's first encounter with a specific built-in AI API, a transient user interaction is required to start a session with create().

Use the UserActivation.isActive` property to confirm a user activation, which could be a click, tap, or key press.

// Check for user activation.
if (navigator.userActivation.isActive) {
  // Create an instance of a built-in API
}

For example with the Summarizer API, you could ask users to interact with button that says "Summarize" to activate Summarizer.create().

Use APIs on localhost

All of the APIs are available on localhost in Chrome.

  1. Go to chrome://flags/#prompt-api-for-gemini-nano.
  2. Select Enabled.
  3. Click Relaunch or restart Chrome.

To confirm Gemini Nano has downloaded and works as intended, open DevTools and type await LanguageModel.availability(); into the console. This should return available.

Troubleshoot localhost

If the model doesn't work as expected, follow these steps:

  1. Restart Chrome.
  2. Go to chrome://components.
  3. Confirm that Optimization Guide On Device Model is present. This means Gemini Nano is either available or downloading.
    • If there's no version number listed, click Check for update to force the download.
  4. Open DevTools and type LanguageModel.availability(); into the console. This should return available.

If necessary, wait for some time and repeat these steps.

Standards process

We're working to standardize these APIs, so that they work across all browsers. This means we have proposed the APIs to the web platforms community, and moved them to the W3C Web Incubator Community Group for further discussion.

We are requesting feedback from the W3C, Mozilla, and WebKit for each API.

Engage and share feedback

If you try built-in AI and have feedback, we'd love to hear it.