Getting Started with Built-In AI

Last updated: March 24, 2026

The Built-In AI APIs are a set of JS APIs, provided by the browser, that allow developers to run inference, on-device, without managing API Keys.


Check Availability

For the Built-In AI APIs, the browser manages the availability of the on-device models that power the Built-In AI APIs. This means that the models might not be available right away (not downloaded yet) or simply, the hardware that the user is opening the site on, might not be powerful enough to run any on-device models.

As a web developer, you need to check the availability of the model. To facilitate the usage of the APIs, all the APIs follow the same availability pattern (the parameters passed to it will differ by API):

javascript
const availability = await *.availability({}); // AvailabilityEnum

AvailabilityEnum

Enum ValueDescriptionWhat should you do?
unavailableThe model is not available, often due to unsupported hardware or a disabled feature.You can’t use this API on this device, unfortunately.
downloadableThe model can be downloaded for on-device use.User’s device is supported but not yet downloaded. Call create on the API to initiate download of the model.
downloadingThe model is currently being downloaded.Wait for the model to be available. You can either wait for the call to create to complete, or continue polling availability.
availableThe model is downloaded and ready for inference.Simply call create and you will be able to use the feature on the user’s device.

Hardware requirements

https://developer.chrome.com/docs/ai/get-started#hardware


Create the Instance

All the APIs follow the same “creation” pattern. Some parameters passed to the create method will be similar and different across the APIs. Look at the individual API documentation for more information.

javascript
const session = await *.create({});

The create methods are asynchronous.


Run Inference

Once the session is created, APIs can be used by calling the API specific method (prompt | translate | detect | summarize | write | rewrite | proofread) to run inference. Similarly, these methods accept similar and different parameters. Look at the individual API documentation for more information.

Streaming

Streaming provides a way for developers to show to users that inference is happening as soon as the tokens are generated.

javascript
const stream = session.(promptStreaming|translateStreaming|summarizeStreaming|writeStreaming|rewriteStreaming|proofreadStreaming)();

The streaming methods return a ReadableStream synchronously (no await needed); consume it with for await (const chunk of stream).

Non-Streaming

Developers also have the option to use non-streaming methods when they want the complete result in a single value — for example when parsing a JSON response (Structured Output) as a whole:

javascript
const result = await session.(prompt|translate|detect|summarize|write|rewrite|proofread)();