Prompt API

Access on-device Gemini Nano models in Chrome for text generation and structured output.

Updated Mar 9, 2026
One-click install
npx skills add https://github.com/amedina/chrome-extension-chrome-ai-skills-dev-sample --skill prompt-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Prompt API
Source: https://github.com/amedina/chrome-extension-chrome-ai-skills-dev-sample/tree/main/.claude/skills/prompt-api
Command: npx skills add https://github.com/amedina/chrome-extension-chrome-ai-skills-dev-sample --skill prompt-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables developers to integrate powerful on-device AI capabilities directly into their Chrome extensions and web pages, eliminating the need for backend servers and API keys for AI inference.

Core Features & Use Cases

  • On-Device Inference: Leverage Gemini Nano directly in the browser for text generation, multimodal understanding (images, audio), and structured output.
  • Real-time Interaction: Build features like chatbots, content summarizers, and image analyzers that respond instantly without network latency.
  • Use Case: Create a Chrome extension that allows users to upload an image and get an instant, detailed description or alt text generated by Gemini Nano running locally on their machine.

Quick Start

Check if the Prompt API is available on this device before attempting to use it.

Frequently Asked Questions about Prompt API

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run AI models directly in a Chrome extension without a backend server?

On-device AI inference in Chrome allows extensions to run models like Gemini Nano locally, eliminating backend servers and API keys. You can leverage the Prompt API directly within the browser for instant text generation and multimodal processing.

Can I generate structured JSON output from on-device AI in the browser?

Yes, the Prompt API supports structured data output using JSON Schema or regex constraints. This enables Chrome extensions to enforce specific formats on text generated locally by Gemini Nano.

What are the requirements to use the on-device Prompt API in Chrome?

To use the on-device Prompt API, you need Chrome 138+ with specific flags enabled. Additionally, your device must have adequate hardware resources to execute the local Gemini Nano model.

Does the Prompt API support multimodal input like images and audio?

Yes, the Prompt API facilitates multimodal input processing. This allows web pages and Chrome extensions to pass images and audio directly to Gemini Nano for local understanding and analysis.

How do I check if on-device AI is available on a user's device before using it?

You must check if the Prompt API is available on the device before attempting to use it. This ensures the local hardware supports on-device AI execution and the required Chrome flags are enabled.

What is the best way to build a real-time chatbot using on-device AI?

Use the Prompt API to access Gemini Nano for streaming text generation directly in the browser. This approach provides real-time interaction without network latency, ideal for chatbots and content summarizers.