app-ai-binding

app-ai-binding is a skill for Claude Code, Codex from cloudflare/vibesdk. It costs 48 tokens per session (1,005 once invoked), scanned A, original, MIT.

A development skill for adding AI model features to generated apps through Cloudflare Workers AI, a service that runs tasks such as chat, summaries, classification, search, image understanding, transcription, and translation.

In plain words
What is it for?
Use it when building generated apps that need chatbots, text or image analysis, embeddings, semantic search, speech transcription, or translation.
Why use it?
It provides a defined way for the app's server to call AI models without placing those calls in browser code or adding unsupported deployment settings.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building generated apps that need chatbots, text or image analysis, embeddings, semantic search, speech transcription, or translation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cloudflare/vibesdk/app-ai-binding
About the project

Cloudflare VibeSDK is an open-source platform for building and deploying full-stack applications through an AI coding agent. Users describe an application, review the agent's questions and edits, inspect previews and errors, and iterate through deployment on Cloudflare. The catalogue entries provide skills and instructions for working with the platform.

cloudflare/vibesdk · 5,443 stars · on GitHub · build.cloudflare.dev

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.

Any agent
npx skills add cloudflare/vibesdk --skill app-ai-binding
Clone the repo
git clone --depth 1 https://github.com/cloudflare/vibesdk

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 app-ai-binding

README.md
[![agentmods](https://agentmods.dev/badge/skills/cloudflare/vibesdk/app-ai-binding/github.svg)](https://agentmods.dev/skills/cloudflare/vibesdk/app-ai-binding)
Your own site
<a href="https://agentmods.dev/skills/cloudflare/vibesdk/app-ai-binding"><img src="https://agentmods.dev/badge/skills/cloudflare/vibesdk/app-ai-binding/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for app-ai-binding

Your own site · 80×15
<a href="https://agentmods.dev/skills/cloudflare/vibesdk/app-ai-binding"><img src="https://agentmods.dev/badge/skills/cloudflare/vibesdk/app-ai-binding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,005 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00048 $0.01005
Opus 5.5 $0.00019 $0.00402
Sonnet 5.5 $0.00010 $0.00201
Haiku 4.5 $0.00005 $0.00101

Measured 6d ago against content hash ee5e8f3f6f04, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

app-ai-binding scanned grade A with 1 finding 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 6d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request): Promise<Response> {
worker/agents/think/skills/app-ai-binding/SKILL.md · 109 lines

How it starts

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

Generated apps can call Workers AI from the App Durable Object through this.env.AI. The platform provides this binding automatically in Dynamic Worker previews and native Cloudflare deployments. Do not add an ai section to the generated app's wrangler.json.

Use only AI.run(model, inputs, options?). Preview uses a restricted proxy with this method, while deployed Workers receive the native Workers AI binding. Methods such as AI.gateway(), AI.models(), AI.autorag(), and AI.toMarkdown() are not portable between preview and deployment.

Type and usage

import { DurableObject } from "cloudflare:workers";

interface Env {
  AI: Ai;
}

export class App extends DurableObject<Env> {
  async fetch(request: Request): Promise<Response> {
    const { prompt } = await request.json<{ prompt: string }>();
    const result = await this.env.AI.run("@cf/meta/llama-4-scout-17b-16e-instruct", {
      messages: [
        { role: "system", content: "Answer clearly and concisely." },
        { role: "user", content: prompt },
      ],
    });
    return Response.json(result);
  }
}

Keep AI calls in the server-side App class. Browser code should call an app API route; it must never receive model credentials or call the binding directly.

Common tasks

Text generation

Use @cf/meta/llama-4-scout-17b-16e-instruct with either prompt or messages:

const result = await this.env.AI.run("@cf/meta/llama-4-scout-17b-16e-instruct", {
  messages: [{ role: "user", content: userPrompt }],
  max_tokens: 512,
});

Embeddings

Use @cf/baai/bge-base-en-v1.5. The response contains embedding vectors in data:

const result = await this.env.AI.run("@cf/baai/bge-base-en-v1.5", {
  text: ["first document", "second document"],
});

Image classification

Use @cf/microsoft/resnet-50 with image bytes converted to a number array:

const image = [...new Uint8Array(await request.arrayBuffer())];
const result = await this.env.AI.run("@cf/microsoft/resnet-50", { image });

Read the full file on GitHub · 109 lines

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. 6d ago First seen · 109 lines · 48 tokens per session scan A ee5e8f3f6f04

Subscribe to this mod's changes

app-ai-binding is a skill published in the GitHub repository cloudflare/vibesdk (5,443 stars, last pushed 7d ago), licensed MIT. It adds 48 tokens to every session and 1,005 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-23.