Agent skill · software engineering · secondsky
cloudflare-workers-ai
Cloudflare Workers AI for serverless GPU inference. Use for LLMs, text/image generation, embeddings, or encountering AI_ERROR, rate limits, token exceeded errors.
Why this skill is useful
Adds executable scripts and specific API patterns for integrating AI models with Cloudflare Workers, which are not commonly found in public documentation.
What it needs
Requires cloudflare-worker-base installed locally. Requires cloudflare account access. About 5k tokens when loaded. Last updated 2026-08-06. 204 stars on the source repository.
What this skill does
Cloudflare Workers AI - Complete Reference Production-ready knowledge domain for building AI-powered applications with Cloudflare Workers AI. Status: Production Ready ✅ Last Updated: 2025-11-21 Dependencies: cloudflare-worker-base (for Worker setup) Latest Versions: wrangler@4.81.0, @cloudflare/workers-types@4.20260408.0 --- Table of Contents 1. Quick Start (5 minutes) 2. Workers AI API Reference 3. Model Selection Guide 4. Common Patterns 5. AI Gateway Integration 6. Rate Limits & Pricing 7. Production Checklist --- Quick Start (5 minutes) 1. Add AI Binding wrangler.jsonc: 2. Run Your First Model 3. Add Streaming (Recommended) Why streaming? Prevents buffering large responses in memory Faster time-to-first-token Better user experience for long-form content Avoids Worker timeout issues --- Workers AI API Reference Core API: env.AI.run() Parameter Type Description ----------- ------ ------------- model string Model ID (e.g., @cf/meta/llama-3.1-8b-instruct) inputs object Model-specific inputs (see model type below) options.gateway.id string AI Gateway ID for caching/logging options.gateway.skipCache boolean Skip AI Gateway cache Returns: Promise<ModelOutput> (non-streaming) or ReadableStream (streaming) Input Types by Model Category Category Key Inputs Output ---------- ------------ -------- Text Generation messages[], stream, maxtokens, temperature { response: string } Embeddings text: string \ string[] { data: number[][], shape: number[] } Image Generation prompt, numsteps, guidance Binary PNG Vision messages[].content[].imageurl { response: string } 📄 Full model details: Load references/models-catalog.md for complete model list, parameters, and rate limits. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills secondsky/cloudflare-workers-ai