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.
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):
const availability = await *.availability({}); // AvailabilityEnum| Enum Value | Description | What should you do? |
|---|---|---|
| unavailable | The model is not available, often due to unsupported hardware or a disabled feature. | You can’t use this API on this device, unfortunately. |
| downloadable | The 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. |
| downloading | The 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. |
| available | The model is downloaded and ready for inference. | Simply call create and you will be able to use the feature on the user’s device. |
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.
const session = await *.create({});The create methods are asynchronous.
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 provides a way for developers to show to users that inference is happening as soon as the tokens are generated.
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).
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:
const result = await session.(prompt|translate|detect|summarize|write|rewrite|proofread)();