prompt-api

prompt-api is a skill for Claude Code, Codex from webmaxru/is-ai-native. It costs 70 tokens per session (1,251 once invoked), scanned A, original, MIT.

A guide for adding the browser Prompt API to JavaScript or TypeScript web applications. The Prompt API lets browser code create language-model sessions and request generated text or structured results.

In plain words
What is it for?
It is for building or debugging browser-based AI features, including prompts, streamed responses, structured output, download progress, and iframe permissions.
Why use it?
It helps developers handle browser support checks, permissions, streaming, and other integration details consistently.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/webmaxru/is-ai-native/prompt-api
Any agent
npx skills add webmaxru/is-ai-native --skill prompt-api
Clone the repo
git clone --depth 1 https://github.com/webmaxru/is-ai-native

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-api

README.md
[![agentmods](https://agentmods.dev/badge/skills/webmaxru/is-ai-native/prompt-api.svg)](https://agentmods.dev/skills/webmaxru/is-ai-native/prompt-api)
Your own site
<a href="https://agentmods.dev/skills/webmaxru/is-ai-native/prompt-api"><img src="https://agentmods.dev/badge/skills/webmaxru/is-ai-native/prompt-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,251 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00070 $0.01251
Opus 5 $0.00035 $0.00626
Sonnet 5 $0.00014 $0.00250
Haiku 4.5 $0.00007 $0.00125

Measured 4d ago against content hash f9cef6805f09, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prompt-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/language-model-service.template.ts, scripts/find-frontend-targets.mjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/prompt-api/SKILL.md · 61 lines

How it starts

The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt API

Procedures

Step 1: Identify the integration surface

  1. Inspect the workspace for browser entry points, UI handlers, and any existing AI abstraction layer.
  2. Execute node scripts/find-frontend-targets.mjs . to inventory likely frontend files and existing Prompt API usage when a Node runtime is available.
  3. If a Node runtime is unavailable, inspect the nearest package.json, HTML entry point, and framework entry files manually to identify the browser app boundary.
  4. If the workspace contains multiple frontend apps, prefer the app that contains the active route, component, or user-requested feature surface.
  5. If the inventory still leaves multiple plausible frontend targets, stop and ask the user which app should receive the Prompt API integration.
  6. If the project is not a browser web app, stop and explain that this skill does not apply.

Step 2: Confirm Prompt API viability

  1. Read references/prompt-api-reference.md before writing code.
  2. Read references/examples.md when the feature needs a spec-valid message shape for text, multimodal, prefix, or tool-enabled sessions.
  3. Read references/compatibility.md when the feature must support multiple browser generations or decide between native support and polyfills.
  4. Read references/polyfills.md when the feature needs concrete package installation or backend configuration examples for Prompt API or Task API polyfills.
  5. Verify that the feature runs in a secure window context and that the language-model permissions-policy allows access from the current frame.
  6. If the integration must run in a Web Worker or other non-window context, stop and explain the platform limitation.
  7. Choose the session shape the feature needs: prompt(), promptStreaming(), initialPrompts, append(), measureContextUsage(), tools, or responseConstraint.
  8. If the project uses TypeScript, add or preserve typings that cover the Prompt API surface used by the project.

Step 3: Implement a guarded session wrapper

  1. Read assets/language-model-service.template.ts and adapt it to the framework, state model, and file layout in the workspace.
  2. Gate session creation behind LanguageModel.availability() using the same creation options that the feature will use at runtime, including expected modalities and tools.
  3. Create sessions only after user activation when model download or instantiation may begin.
  4. Use AbortController for cancelable prompts and call destroy() when the session is no longer needed.
  5. If the feature runs in a cross-origin iframe, require allow="language-model" on the embedding iframe.
  6. Do not depend on params(), topK, or temperature; the spec marks them EXPERIMENTAL and extension-only, so portable web page integrations must not require them.
  7. Treat availability() as a passive capability check: if it reports downloading before user activation, do not assume the current page initiated that download or lock the UI into an app-started busy state.

Read the full file on GitHub · 61 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 61 lines · 70 tokens per session scan A f9cef6805f09

Subscribe to this mod's changes

prompt-api is a skill published in the GitHub repository webmaxru/is-ai-native (5 stars, last pushed 12d ago), licensed MIT. It adds 70 tokens to every session and 1,251 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.