---
title: API updates on Chrome on-device AI
url: https://calvin.my/posts/api-updates-on-chrome-on-device-ai
published: 2024-09-27
updated: 2026-09-17
category: AI
tags:
- Gemini Nano
- gemini
- Chrome
- webAI
summary: Chrome’s on-device AI APIs have introduced breaking changes since their initial release. The package namespace and methods for checking availability and creating sessions have been updated, and session creation now supports system prompts. Developers should revise existing integrations to use the new API structure and capability checks. The streaming interface and its output behavior are unchanged, limiting the migration impact for applications that rely on streamed responses.
---

# API updates on Chrome on-device AI

This article is an update for the previous articles below:

1. [https://calvin.my/posts/on-device-generative-ai-with-gemini-nano](../posts/on-device-generative-ai-with-gemini-nano)
2. [https://calvin.my/posts/on-device-generative-ai-with-gemini-nano-part-2](../posts/on-device-generative-ai-with-gemini-nano-part-2)

* * *

A few months after its initial release, the Chrome on-device AI has some breaking changes on the API.

1. Package

   ```javascript
   # Previous
   window.ai

   # New
   ai.assistant
   ```

2. Checking availability of the API.

   ```javascript
   const {available, defaultTopK } = await ai.assistant.capabilities();

   if (available !== "no") {
     // available
   }
   ```

3. New create API

   ```javascript
   const session = await ai.assistant.create({
       temperature: 0,
       topK: defaultTopK
   });
   ```

4. Sending System Prompt is now possible.

   ```javascript
   const systemPrompt = "You are a helpful assistant.";
   const session = await ai.assistant.create({
       temperature: 0,
       topK: defaultTopK,
       systemPrompt: systemPrompt
   });
   ```

* * *

The streaming API and streaming output remain unchanged.
