Prompt API for extension

This document describes the status of the current implementation of the Prompt API for Chrome extensions, and how to verify.

What’s supported

The implementation generally intends to follow the explainer.

Activation

The API can be enabled by participating in the extension origin trial named AIPromptAPIForExtension. After obtaining the trial token, the extension authors need to configure it in the manifest.json:

{
  "trial_tokens": [<GENERATED_TOKEN>],
}

Verifying the API is working

The extension authors can verify if the API is available by checking for the presence of the LanguageModel entrypoint from extension window and worker scripts. If the object is defined, the authors can follow the explainer and developer docs to check availability and test the APIs usage.

Related Links