{"id":"0f982d09-5223-4876-b18f-144b5f1b7490","entityType":"agent","slug":"clawhub-tbeard602-cloudflare-deploy","name":"Cloudflare Deploy","canonicalUrl":"https://www.xpersona.co/agent/clawhub-tbeard602-cloudflare-deploy","canonicalPath":"/agent/clawhub-tbeard602-cloudflare-deploy","generatedAt":"2026-10-11T17:41:20.789Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":null},"description":"Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or... Skill: Cloudflare Deploy Owner: tbeard602 Summary: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-06-07T13:54:49.351Z | auto Initial release of the cloudflare-deploy skill. - Consolidates deployment guidance for Cloudflare Workers, Pages, and related platf","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1745y3889m0whjz7wsbayv6kn87z206:cloudflare-deploy","sourceUrl":"https://clawhub.ai/tbeard602/cloudflare-deploy","homepage":"https://clawhub.ai/tbeard602/skills/cloudflare-deploy","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/tbeard602/cloudflare-deploy","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/tbeard602/skills/cloudflare-deploy","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":null},"stars":null,"forks":null,"downloads":1053,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:00:41.700Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T14:00:41.712Z","lastCrawledAt":"2026-10-11T14:00:41.700Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T14:00:41.700Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-06-07T13:54:49.351Z","changelog":"Initial release of the cloudflare-deploy skill. - Consolidates deployment guidance for Cloudflare Workers, Pages, and related platform services. - Includes quick decision trees to help choose between Cloudflare compute, storage, AI, networking, and security products. - Provides product index with reference paths for all Cloudflare platform features. - Guides users through authentication and handling network permissions during deployment. - Offers troubleshooting steps for common deployment issues, including sandbox network escalation.","fileCount":313,"zipByteSize":605281}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1745y3889m0whjz7wsbayv6kn87z206:cloudflare-deploy","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T17:41:20.788Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-tbeard602-cloudflare-deploy/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":null},"readme":"Skill: Cloudflare Deploy\n\nOwner: tbeard602\n\nSummary: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or...\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-06-07T13:54:49.351Z | auto\n\nInitial release of the cloudflare-deploy skill.\n\n- Consolidates deployment guidance for Cloudflare Workers, Pages, and related platform services.\n- Includes quick decision trees to help choose between Cloudflare compute, storage, AI, networking, and security products.\n- Provides product index with reference paths for all Cloudflare platform features.\n- Guides users through authentication and handling network permissions during deployment.\n- Offers troubleshooting steps for common deployment issues, including sandbox network escalation.\n\nArchive index:\n\nArchive v1.0.0: 313 files, 605281 bytes\n\nFiles: agents/openai.yaml (331b), assets/cloudflare-small.svg (1221b), LICENSE.txt (10776b), references/agents-sdk/api.md (5862b), references/agents-sdk/configuration.md (3575b), references/agents-sdk/gotchas.md (5108b), references/agents-sdk/patterns.md (5595b), references/agents-sdk/README.md (2765b), references/ai-gateway/configuration.md (2954b), references/ai-gateway/dynamic-routing.md (1835b), references/ai-gateway/features.md (2726b), references/ai-gateway/README.md (6308b), references/ai-gateway/sdk-integration.md (2684b), references/ai-gateway/troubleshooting.md (2420b), references/ai-search/api.md (2519b), references/ai-search/configuration.md (1760b), references/ai-search/gotchas.md (2135b), references/ai-search/patterns.md (2008b), references/ai-search/README.md (4521b), references/analytics-engine/api.md (3161b), references/analytics-engine/configuration.md (2361b), references/analytics-engine/gotchas.md (2018b), references/analytics-engine/patterns.md (2312b), references/analytics-engine/README.md (3195b), references/api-shield/api.md (3900b), references/api-shield/configuration.md (5020b), references/api-shield/gotchas.md (4946b), references/api-shield/patterns.md (5844b), references/api-shield/README.md (1796b), references/api/api.md (4308b), references/api/configuration.md (3748b), references/api/gotchas.md (5390b), references/api/patterns.md (4639b), references/api/README.md (2381b), references/argo-smart-routing/api.md (6579b), references/argo-smart-routing/configuration.md (4457b), references/argo-smart-routing/gotchas.md (4327b), references/argo-smart-routing/patterns.md (3053b), references/argo-smart-routing/README.md (4060b), references/bindings/api.md (5199b), references/bindings/configuration.md (4496b), references/bindings/gotchas.md (6169b), references/bindings/patterns.md (5058b), references/bindings/README.md (4042b), references/bot-management/api.md (5803b), references/bot-management/configuration.md (5744b), references/bot-management/gotchas.md (5657b), references/bot-management/patterns.md (4970b), references/bot-management/README.md (3762b), references/browser-rendering/api.md (2976b), references/browser-rendering/configuration.md (1802b), references/browser-rendering/gotchas.md (2520b), references/browser-rendering/patterns.md (2647b), references/browser-rendering/README.md (3092b), references/c3/api.md (2286b), references/c3/configuration.md (1637b), references/c3/gotchas.md (2307b), references/c3/patterns.md (2203b), references/c3/README.md (3352b), references/cache-reserve/api.md (6018b), references/cache-reserve/configuration.md (3660b), references/cache-reserve/gotchas.md (5797b), references/cache-reserve/patterns.md (6265b), references/cache-reserve/README.md (5609b), references/containers/api.md (4310b), references/containers/configuration.md (5424b), references/containers/gotchas.md (4485b), references/containers/patterns.md (4925b), references/containers/README.md (3531b), references/cron-triggers/api.md (5866b), references/cron-triggers/configuration.md (4250b), references/cron-triggers/gotchas.md (6316b), references/cron-triggers/patterns.md (6980b), references/cron-triggers/README.md (2949b), references/d1/api.md (6806b), references/d1/configuration.md (5386b), references/d1/gotchas.md (4318b), references/d1/patterns.md (7251b), references/d1/README.md (4719b), references/ddos/api.md (4170b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: cloudflare-deploy\ndescription: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.\n---\n\n# Cloudflare Deploy\n\nConsolidated skill for building on the Cloudflare platform. Use decision trees below to find the right product, then load detailed references.\n\n## Prerequisites\n\n- When sandboxing blocks the deployment network calls, rerun with `sandbox_permissions=require_escalated`.\n- The deployment might take a few minutes. Use appropriate timeout values.\n\n## Authentication (Required Before Deploy)\n\nVerify auth before `wrangler deploy`, `wrangler pages deploy`, or `npm run deploy`:\n\n```bash\nnpx wrangler whoami    # Shows account if authenticated\n```\n\nNot authenticated? → `references/wrangler/auth.md`\n- Interactive/local: `wrangler login` (one-time OAuth)\n- CI/CD: Set `CLOUDFLARE_API_TOKEN` env var\n\n## Quick Decision Trees\n\n### \"I need to run code\"\n\n```\nNeed to run code?\n├─ Serverless functions at the edge → workers/\n├─ Full-stack web app with Git deploys → pages/\n├─ Stateful coordination/real-time → durable-objects/\n├─ Long-running multi-step jobs → workflows/\n├─ Run containers → containers/\n├─ Multi-tenant (customers deploy code) → workers-for-platforms/\n├─ Scheduled tasks (cron) → cron-triggers/\n├─ Lightweight edge logic (modify HTTP) → snippets/\n├─ Process Worker execution events (logs/observability) → tail-workers/\n└─ Optimize latency to backend infrastructure → smart-placement/\n```\n\n### \"I need to store data\"\n\n```\nNeed storage?\n├─ Key-value (config, sessions, cache) → kv/\n├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL)\n├─ Object/file storage (S3-compatible) → r2/\n├─ Message queue (async processing) → queues/\n├─ Vector embeddings (AI/semantic search) → vectorize/\n├─ Strongly-consistent per-entity state → durable-objects/ (DO storage)\n├─ Secrets management → secrets-store/\n├─ Streaming ETL to R2 → pipelines/\n└─ Persistent cache (long-term retention) → cache-reserve/\n```\n\n### \"I need AI/ML\"\n\n```\nNeed AI?\n├─ Run inference (LLMs, embeddings, images) → workers-ai/\n├─ Vector database for RAG/search → vectorize/\n├─ Build stateful AI agents → agents-sdk/\n├─ Gateway for any AI provider (caching, routing) → ai-gateway/\n└─ AI-powered search widget → ai-search/\n```\n\n### \"I need networking/connectivity\"\n\n```\nNeed networking?\n├─ Expose local service to internet → tunnel/\n├─ TCP/UDP proxy (non-HTTP) → spectrum/\n├─ WebRTC TURN server → turn/\n├─ Private network connectivity → network-interconnect/\n├─ Optimize routing → argo-smart-routing/\n├─ Optimize latency to backend (not user) → smart-placement/\n└─ Real-time video/audio → realtimekit/ or realtime-sfu/\n```\n\n### \"I need security\"\n\n```\nNeed security?\n├─ Web Application Firewall → waf/\n├─ DDoS protection → ddos/\n├─ Bot detection/management → bot-management/\n├─ API protection → api-shield/\n├─ CAPTCHA alternative → turnstile/\n└─ Credential leak detection → waf/ (managed ruleset)\n```\n\n### \"I need media/content\"\n\n```\nNeed media?\n├─ Image optimization/transformation → images/\n├─ Video streaming/encoding → stream/\n├─ Browser automation/screenshots → browser-rendering/\n└─ Third-party script management → zaraz/\n```\n\n### \"I need infrastructure-as-code\"\n\n```\nNeed IaC? → pulumi/ (Pulumi), terraform/ (Terraform), or api/ (REST API)\n```\n\n## Product Index\n\n### Compute & Runtime\n| Product | Reference |\n|---------|-----------|\n| Workers | `references/workers/` |\n| Pages | `references/pages/` |\n| Pages Functions | `references/pages-functions/` |\n| Durable Objects | `references/durable-objects/` |\n| Workflows | `references/workflows/` |\n| Containers | `references/containers/` |\n| Workers for Platforms | `references/workers-for-platforms/` |\n| Cron Triggers | `references/cron-triggers/` |\n| Tail Workers | `references/tail-workers/` |\n| Snippets | `references/snippets/` |\n| Smart Placement | `references/smart-placement/` |\n\n### Storage & Data\n| Product | Reference |\n|---------|-----------|\n| KV | `references/kv/` |\n| D1 | `references/d1/` |\n| R2 | `references/r2/` |\n| Queues | `references/queues/` |\n| Hyperdrive | `references/hyperdrive/` |\n| DO Storage | `references/do-storage/` |\n| Secrets Store | `references/secrets-store/` |\n| Pipelines | `references/pipelines/` |\n| R2 Data Catalog | `references/r2-data-catalog/` |\n| R2 SQL | `references/r2-sql/` |\n\n### AI & Machine Learning\n| Product | Reference |\n|---------|-----------|\n| Workers AI | `references/workers-ai/` |\n| Vectorize | `references/vectorize/` |\n| Agents SDK | `references/agents-sdk/` |\n| AI Gateway | `references/ai-gateway/` |\n| AI Search | `references/ai-search/` |\n\n### Networking & Connectivity\n| Product | Reference |\n|---------|-----------|\n| Tunnel | `references/tunnel/` |\n| Spectrum | `references/spectrum/` |\n| TURN | `references/turn/` |\n| Network Interconnect | `references/network-interconnect/` |\n| Argo Smart Routing | `references/argo-smart-routing/` |\n| Workers VPC | `references/workers-vpc/` |\n\n### Security\n| Product | Reference |\n|---------|-----------|\n| WAF | `references/waf/` |\n| DDoS Protection | `references/ddos/` |\n| Bot Management | `references/bot-management/` |\n| API Shield | `references/api-shield/` |\n| Turnstile | `references/turnstile/` |\n\n### Media & Content\n| Product | Reference |\n|---------|-----------|\n| Images | `references/images/` |\n| Stream | `references/stream/` |\n| Browser Rendering | `references/browser-rendering/` |\n| Zaraz | `references/zaraz/` |\n\n### Real-Time Communication\n| Product | Reference |\n|---------|-----------|\n| RealtimeKit | `references/realtimekit/` |\n| Realtime SFU | `references/realtime-sfu/` |\n\n### Developer Tools\n| Product | Reference |\n|---------|-----------|\n| Wrangler | `references/wrangler/` |\n| Miniflare | `references/miniflare/` |\n| C3 | `references/c3/` |\n| Observability | `references/observability/` |\n| Analytics Engine | `references/analytics-engine/` |\n| Web Analytics | `references/web-analytics/` |\n| Sandbox | `references/sandbox/` |\n| Workerd | `references/workerd/` |\n| Workers Playground | `references/workers-playground/` |\n\n### Infrastructure as Code\n| Product | Reference |\n|---------|-----------|\n| Pulumi | `references/pulumi/` |\n| Terraform | `references/terraform/` |\n| API | `references/api/` |\n\n### Other Services\n| Product | Reference |\n|---------|-----------|\n| Email Routing | `references/email-routing/` |\n| Email Workers | `references/email-workers/` |\n| Static Assets | `references/static-assets/` |\n| Bindings | `references/bindings/` |\n| Cache Reserve | `references/cache-reserve/` |\n\n## Troubleshooting\n\n### Escalated Network Access\n\nIf deployment fails due to network issues (timeouts, DNS errors, connection resets), rerun the deploy with escalated permissions (use `sandbox_permissions=require_escalated`). The deploy requires escalated network access when sandbox networking blocks outbound requests.\n\nExample guidance to the user:\n\n```\nThe deploy needs escalated network access to deploy to Cloudflare. I can rerun the command with escalated permissions—want me to proceed?\n```\n\nFile v1.0.0:references/agents-sdk/README.md\n\n# Cloudflare Agents SDK\n\nCloudflare Agents SDK enables building AI-powered agents on Durable Objects with state, WebSockets, SQL, scheduling, and AI integration.\n\n## Core Value\nBuild stateful, globally distributed AI agents with persistent memory, real-time connections, scheduled tasks, and async workflows.\n\n## When to Use\n- Persistent state + memory required\n- Real-time WebSocket connections\n- Long-running workflows (minutes/hours)\n- Chat interfaces with AI models\n- Scheduled/recurring tasks with state\n- DB queries with agent state\n\n## What Type of Agent?\n\n| Use Case | Class | Key Features |\n|----------|-------|--------------|\n| AI chat interface | `AIChatAgent` | Auto-streaming, tools, message history, resumable |\n| MCP tool provider | `Agent` + MCP | Expose tools to AI systems |\n| Custom logic/routing | `Agent` | Full control, WebSockets, email, SQL |\n| Real-time collaboration | `Agent` | WebSocket state, broadcasts |\n| Email processing | `Agent` | `onEmail()` handler |\n\n## Quick Start\n\n**AI Chat Agent:**\n```typescript\nimport { AIChatAgent } from \"agents\";\nimport { openai } from \"@ai-sdk/openai\";\n\nexport class ChatAgent extends AIChatAgent<Env> {\n  async onChatMessage(onFinish) {\n    return this.streamText({\n      model: openai(\"gpt-4\"),\n      messages: this.messages,\n      onFinish,\n    });\n  }\n}\n```\n\n**Base Agent:**\n```typescript\nimport { Agent } from \"agents\";\n\nexport class MyAgent extends Agent<Env> {\n  onStart() {\n    this.sql`CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY)`;\n  }\n  \n  async onRequest(request: Request) {\n    return Response.json({ state: this.state });\n  }\n}\n```\n\n## Reading Order\n\n| Task | Files to Read |\n|------|---------------|\n| Quick start | README only |\n| Build chat agent | README → api.md (AIChatAgent) → patterns.md |\n| Setup project | README → configuration.md |\n| Add React frontend | README → api.md (Client Hooks) → patterns.md |\n| Build MCP server | api.md (MCP) → patterns.md |\n| Background tasks | api.md (Scheduling, Task Queue) → patterns.md |\n| Debug issues | gotchas.md |\n\n## Package Entry Points\n\n| Import | Purpose |\n|--------|---------|\n| `agents` | Server-side Agent classes, lifecycle |\n| `agents/react` | `useAgent()` hook for WebSocket connections |\n| `agents/ai-react` | `useAgentChat()` hook for AI chat UIs |\n\n## In This Reference\n- [configuration.md](./configuration.md) - SDK setup, wrangler config, routing\n- [api.md](./api.md) - Agent classes, lifecycle, client hooks\n- [patterns.md](./patterns.md) - Common workflows, best practices\n- [gotchas.md](./gotchas.md) - Common issues, limits\n\n## See Also\n- durable-objects - Agent infrastructure\n- d1 - External database integration\n- workers-ai - AI model integration\n- vectorize - Vector search for RAG patterns\n\nFile v1.0.0:references/ai-gateway/README.md\n\n# Cloudflare AI Gateway\n\nExpert guidance for implementing Cloudflare AI Gateway - a universal gateway for AI model providers with analytics, caching, rate limiting, and routing capabilities.\n\n## When to Use This Reference\n\n- Setting up AI Gateway for any AI provider (OpenAI, Anthropic, Workers AI, etc.)\n- Implementing caching, rate limiting, or request retry/fallback\n- Configuring dynamic routing with A/B testing or model fallbacks\n- Managing provider API keys securely with BYOK\n- Adding security features (guardrails, DLP)\n- Setting up observability with logging and custom metadata\n- Debugging AI Gateway requests or optimizing configurations\n\n## Quick Start\n\n**What's your setup?**\n\n- **Using Vercel AI SDK** → Pattern 1 (recommended) - see [sdk-integration.md](./sdk-integration.md)\n- **Using OpenAI SDK** → Pattern 2 - see [sdk-integration.md](./sdk-integration.md)\n- **Cloudflare Worker + Workers AI** → Pattern 3 - see [sdk-integration.md](./sdk-integration.md)\n- **Direct HTTP (any language)** → Pattern 4 - see [configuration.md](./configuration.md)\n- **Framework (LangChain, etc.)** → See [sdk-integration.md](./sdk-integration.md)\n\n## Pattern 1: Vercel AI SDK (Recommended)\n\nMost modern pattern using official `ai-gateway-provider` package with automatic fallbacks.\n\n```typescript\nimport { createAiGateway } from 'ai-gateway-provider';\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { generateText } from 'ai';\n\nconst gateway = createAiGateway({\n  accountId: process.env.CF_ACCOUNT_ID,\n  gateway: process.env.CF_GATEWAY_ID,\n});\n\nconst openai = createOpenAI({ \n  apiKey: process.env.OPENAI_API_KEY \n});\n\n// Single model\nconst { text } = await generateText({\n  model: gateway(openai('gpt-4o')),\n  prompt: 'Hello'\n});\n\n// Automatic fallback array\nconst { text } = await generateText({\n  model: gateway([\n    openai('gpt-4o'),              // Try first\n    anthropic('claude-sonnet-4-5'), // Fallback\n  ]),\n  prompt: 'Hello'\n});\n```\n\n**Install:** `npm install ai-gateway-provider ai @ai-sdk/openai @ai-sdk/anthropic`\n\n## Pattern 2: OpenAI SDK\n\nDrop-in replacement for OpenAI API with multi-provider support.\n\n```typescript\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n  apiKey: process.env.OPENAI_API_KEY,\n  baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/compat`,\n  defaultHeaders: {\n    'cf-aig-authorization': `Bearer ${cfToken}` // For authenticated gateways\n  }\n});\n\n// Switch providers by changing model format: {provider}/{model}\nconst response = await client.chat.completions.create({\n  model: 'openai/gpt-4o', // or 'anthropic/claude-sonnet-4-5'\n  messages: [{ role: 'user', content: 'Hello!' }]\n});\n```\n\n## Pattern 3: Workers AI Binding\n\nFor Cloudflare Workers using Workers AI.\n\n```typescript\nexport default {\n  async fetch(request, env, ctx) {\n    const response = await env.AI.run(\n      '@cf/meta/llama-3-8b-instruct',\n      { messages: [{ role: 'user', content: 'Hello!' }] },\n      { \n        gateway: { \n          id: 'my-gateway',\n          metadata: { userId: '123', team: 'engineering' }\n        } \n      }\n    );\n    \n    return Response.json(response);\n  }\n};\n```\n\n## Headers Quick Reference\n\n| Header | Purpose | Example | Notes |\n|--------|---------|---------|-------|\n| `cf-aig-authorization` | Gateway auth | `Bearer {token}` | Required for authenticated gateways |\n| `cf-aig-metadata` | Tracking | `{\"userId\":\"x\"}` | Max 5 entries, flat structure |\n| `cf-aig-cache-ttl` | Cache duration | `3600` | Seconds, min 60, max 2592000 (30 days) |\n| `cf-aig-skip-cache` | Bypass cache | `true` | - |\n| `cf-aig-cache-key` | Custom cache key | `my-key` | Must be unique per response |\n| `cf-aig-collect-log` | Skip logging | `false` | Default: true |\n| `cf-aig-cache-status` | Cache hit/miss | Response only | `HIT` or `MISS` |\n\n## In This Reference\n\n| File | Purpose |\n|------|---------|\n| [sdk-integration.md](./sdk-integration.md) | Vercel AI SDK, OpenAI SDK, Workers binding patterns |\n| [configuration.md](./configuration.md) | Dashboard setup, wrangler, API tokens |\n| [features.md](./features.md) | Caching, rate limits, guardrails, DLP, BYOK, unified billing |\n| [dynamic-routing.md](./dynamic-routing.md) | Fallbacks, A/B testing, conditional routing |\n| [troubleshooting.md](./troubleshooting.md) | Debugging, errors, observability, gotchas |\n\n## Reading Order\n\n| Task | Files |\n|------|-------|\n| First-time setup | README + [configuration.md](./configuration.md) |\n| SDK integration | README + [sdk-integration.md](./sdk-integration.md) |\n| Enable caching | README + [features.md](./features.md) |\n| Setup fallbacks | README + [dynamic-routing.md](./dynamic-routing.md) |\n| Debug errors | README + [troubleshooting.md](./troubleshooting.md) |\n\n## Architecture\n\nAI Gateway acts as a proxy between your application and AI providers:\n\n```\nYour App → AI Gateway → AI Provider (OpenAI, Anthropic, etc.)\n         ↓\n    Analytics, Caching, Rate Limiting, Logging\n```\n\n**Key URL patterns:**\n- Unified API (OpenAI-compatible): `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/compat/chat/completions`\n- Provider-specific: `https://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}/{provider}/{endpoint}`\n- Dynamic routes: Use route name instead of model: `dynamic/{route-name}`\n\n## Gateway Types\n\n1. **Unauthenticated Gateway**: Open access (not recommended for production)\n2. **Authenticated Gateway**: Requires `cf-aig-authorization` header with Cloudflare API token (recommended)\n\n## Provider Authentication Options\n\n1. **Unified Billing**: Use AI Gateway billing to pay for inference (keyless mode - no provider API key needed)\n2. **BYOK (Store Keys)**: Store provider API keys in Cloudflare dashboard\n3. **Request Headers**: Include provider API key in each request\n\n## Related Skills\n\n- [Workers AI](../workers-ai/README.md) - For `env.AI.run()` details\n- [Agents SDK](../agents-sdk/README.md) - For stateful AI patterns\n- [Vectorize](../vectorize/README.md) - For RAG patterns with embeddings\n\n## Resources\n\n- [Official Docs](https://developers.cloudflare.com/ai-gateway/)\n- [API Reference](https://developers.cloudflare.com/api/resources/ai_gateway/)\n- [Provider Guides](https://developers.cloudflare.com/ai-gateway/usage/providers/)\n- [Discord Community](https://discord.cloudflare.com)\n\nFile v1.0.0:references/ai-search/README.md\n\n# Cloudflare AI Search Reference\n\nExpert guidance for implementing Cloudflare AI Search (formerly AutoRAG), Cloudflare's managed semantic search and RAG service.\n\n## Overview\n\n**AI Search** is a managed RAG (Retrieval-Augmented Generation) pipeline that combines:\n- Automatic semantic indexing of your content\n- Vector similarity search\n- Built-in LLM generation\n\n**Key value propositions:**\n- **Zero vector management** - No manual embedding, indexing, or storage\n- **Auto-indexing** - Content automatically re-indexed every 6 hours\n- **Built-in generation** - Optional AI response generation from retrieved context\n- **Multi-source** - Index from R2 buckets or website crawls\n\n**Data source options:**\n- **R2 bucket** - Index files from Cloudflare R2 (supports MD, TXT, HTML, PDF, DOC, CSV, JSON)\n- **Website** - Crawl and index website content (requires Cloudflare-hosted domain)\n\n**Indexing lifecycle:**\n- Automatic 6-hour refresh cycle\n- Manual \"Force Sync\" available (30s rate limit)\n- Not designed for real-time updates\n\n## Quick Start\n\n**1. Create AI Search instance in dashboard:**\n- Go to Cloudflare Dashboard → AI Search → Create\n- Choose data source (R2 or website)\n- Configure instance name and settings\n\n**2. Configure Worker:**\n\n```jsonc\n// wrangler.jsonc\n{\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\n**3. Use in Worker:**\n\n```typescript\nexport default {\n  async fetch(request, env) {\n    const answer = await env.AI.autorag(\"my-search-instance\").aiSearch({\n      query: \"How do I configure caching?\",\n      model: \"@cf/meta/llama-3.3-70b-instruct-fp8-fast\"\n    });\n    \n    return Response.json({ answer: answer.response });\n  }\n};\n```\n\n## When to Use AI Search\n\n### AI Search vs Vectorize\n\n| Factor | AI Search | Vectorize |\n|--------|-----------|-----------|\n| **Management** | Fully managed | Manual embedding + indexing |\n| **Use when** | Want zero-ops RAG pipeline | Need custom embeddings/control |\n| **Indexing** | Automatic (6hr cycle) | Manual via API |\n| **Generation** | Built-in optional | Bring your own LLM |\n| **Data sources** | R2 or website | Manual insert |\n| **Best for** | Docs, support, enterprise search | Custom ML pipelines, real-time |\n\n### AI Search vs Direct Workers AI\n\n| Factor | AI Search | Workers AI (direct) |\n|--------|-----------|---------------------|\n| **Context** | Automatic retrieval | Manual context building |\n| **Use when** | Need RAG (search + generate) | Simple generation tasks |\n| **Indexing** | Built-in | Not applicable |\n| **Best for** | Knowledge bases, docs | Simple chat, transformations |\n\n### search() vs aiSearch()\n\n| Method | Returns | Use When |\n|--------|---------|----------|\n| `search()` | Search results only | Building custom UI, need raw chunks |\n| `aiSearch()` | AI response + results | Need ready-to-use answer (chatbot, Q&A) |\n\n### Real-time Updates Consideration\n\n**AI Search is NOT ideal if:**\n- Need real-time content updates (<6 hours)\n- Content changes multiple times per hour\n- Strict freshness requirements\n\n**AI Search IS ideal if:**\n- Content relatively stable (docs, policies, knowledge bases)\n- 6-hour refresh acceptable\n- Prefer zero-ops over real-time\n\n## Platform Limits\n\n| Limit | Value |\n|-------|-------|\n| Max instances per account | 10 |\n| Max files per instance | 100,000 |\n| Max file size | 4 MB |\n| Index frequency | Every 6 hours |\n| Force Sync rate limit | Once per 30 seconds |\n| Filter nesting depth | 2 levels |\n| Filters per compound | 10 |\n| Score threshold range | 0.0 - 1.0 |\n\n## Reading Order\n\nNavigate these references based on your task:\n\n| Task | Read | Est. Time |\n|------|------|-----------|\n| **Understand AI Search** | README only | 5 min |\n| **Implement basic search** | README → api.md | 10 min |\n| **Configure data source** | README → configuration.md | 10 min |\n| **Production patterns** | patterns.md | 15 min |\n| **Debug issues** | gotchas.md | 10 min |\n| **Full implementation** | README → api.md → patterns.md | 30 min |\n\n## In This Reference\n\n- **[api.md](api.md)** - API endpoints, methods, TypeScript interfaces\n- **[configuration.md](configuration.md)** - Setup, data sources, wrangler config\n- **[patterns.md](patterns.md)** - Common patterns, decision guidance, code examples\n- **[gotchas.md](gotchas.md)** - Troubleshooting, code-level gotchas, limits\n\n## See Also\n\n- [Cloudflare AI Search Docs](https://developers.cloudflare.com/ai-search/)\n- [Workers AI Docs](https://developers.cloudflare.com/workers-ai/)\n- [Vectorize Docs](https://developers.cloudflare.com/vectorize/)\n\nFile v1.0.0:references/analytics-engine/README.md\n\n# Cloudflare Workers Analytics Engine Reference\n\nExpert guidance for implementing unlimited-cardinality analytics at scale using Cloudflare Workers Analytics Engine.\n\n## What is Analytics Engine?\n\nTime-series analytics database designed for high-cardinality data (millions of unique dimensions). Write data points from Workers, query via SQL API. Use for:\n- Custom user-facing analytics dashboards\n- Usage-based billing & metering\n- Per-customer/per-feature monitoring\n- High-frequency instrumentation without performance impact\n\n**Key Capability:** Track metrics with unlimited unique values (e.g., millions of user IDs, API keys) without performance degradation.\n\n## Core Concepts\n\n| Concept | Description | Example |\n|---------|-------------|---------|\n| **Dataset** | Logical table for related metrics | `api_requests`, `user_events` |\n| **Data Point** | Single measurement with timestamp | One API request's metrics |\n| **Blobs** | String dimensions (max 20) | endpoint, method, status, user_id |\n| **Doubles** | Numeric values (max 20) | latency_ms, request_count, bytes |\n| **Indexes** | Filtered blobs for efficient queries | customer_id, api_key |\n\n## Reading Order\n\n| Task | Start Here | Then Read |\n|------|------------|-----------|\n| **First-time setup** | [configuration.md](configuration.md) → [api.md](api.md) → [patterns.md](patterns.md) | |\n| **Writing data** | [api.md](api.md) → [gotchas.md](gotchas.md) (sampling) | |\n| **Querying data** | [api.md](api.md) (SQL API) → [patterns.md](patterns.md) (examples) | |\n| **Debugging** | [gotchas.md](gotchas.md) → [api.md](api.md) (limits) | |\n| **Optimization** | [patterns.md](patterns.md) (anti-patterns) → [gotchas.md](gotchas.md) | |\n\n## When to Use Analytics Engine\n\n```\nNeed to track metrics? → Yes\n  ↓\nMillions of unique dimension values? → Yes\n    ↓\n  Need real-time queries? → Yes\n      ↓\n    Use Analytics Engine ✓\n\nAlternative scenarios:\n- Low cardinality (<10k unique values) → Workers Analytics (free tier)\n- Complex joins/relations → D1 Database\n- Logs/debugging → Tail Workers (logpush)\n- External tools → Send to external analytics (Datadog, etc.)\n```\n\n## Quick Start\n\n1. Add binding to `wrangler.jsonc`:\n```jsonc\n{\n  \"analytics_engine_datasets\": [\n    { \"binding\": \"ANALYTICS\", \"dataset\": \"my_events\" }\n  ]\n}\n```\n\n2. Write data points (fire-and-forget, no await):\n```typescript\nenv.ANALYTICS.writeDataPoint({\n  blobs: [\"/api/users\", \"GET\", \"200\"],\n  doubles: [145.2, 1],  // latency_ms, count\n  indexes: [customerId]\n});\n```\n\n3. Query via SQL API (HTTP):\n```sql\nSELECT blob1, SUM(double2) AS total_requests\nFROM my_events\nWHERE index1 = 'customer_123'\n  AND timestamp >= NOW() - INTERVAL '7' DAY\nGROUP BY blob1\nORDER BY total_requests DESC\n```\n\n## In This Reference\n\n- **[configuration.md](configuration.md)** - Setup, bindings, TypeScript types, limits\n- **[api.md](api.md)** - `writeDataPoint()`, SQL API, query syntax\n- **[patterns.md](patterns.md)** - Use cases, examples, anti-patterns\n- **[gotchas.md](gotchas.md)** - Sampling, index selection, troubleshooting\n\n## See Also\n\n- [Cloudflare Analytics Engine Docs](https://developers.cloudflare.com/analytics/analytics-engine/)\n\nFile v1.0.0:references/api-shield/README.md\n\n# Cloudflare API Shield Reference\n\nExpert guidance for API Shield - comprehensive API security suite for discovery, protection, and monitoring.\n\n## Reading Order\n\n| Task | Files to Read |\n|------|---------------|\n| Initial setup | README → configuration.md |\n| Implement JWT validation | configuration.md → api.md |\n| Add schema validation | configuration.md → patterns.md |\n| Detect API attacks | patterns.md → api.md |\n| Debug issues | gotchas.md |\n\n## Feature Selection\n\nWhat protection do you need?\n\n```\n├─ Validate request/response structure → Schema Validation 2.0 (configuration.md)\n├─ Verify auth tokens → JWT Validation (configuration.md)\n├─ Client certificates → mTLS (configuration.md)\n├─ Detect BOLA attacks → BOLA Detection (patterns.md)\n├─ Track auth coverage → Auth Posture (patterns.md)\n├─ Stop volumetric abuse → Abuse Detection (patterns.md)\n└─ Discover shadow APIs → API Discovery (api.md)\n```\n\n## In This Reference\n\n- **[configuration.md](configuration.md)** - Setup, session identifiers, rules, token/mTLS configs\n- **[api.md](api.md)** - Endpoint management, discovery, validation APIs, GraphQL operations\n- **[patterns.md](patterns.md)** - Common patterns, progressive rollout, OWASP mappings, workflows\n- **[gotchas.md](gotchas.md)** - Troubleshooting, false positives, performance, best practices\n\n## Quick Start\n\nAPI Shield: Enterprise-grade API security (Discovery, Schema Validation 2.0, JWT, mTLS, BOLA Detection, Auth Posture). Available as Enterprise add-on with preview access.\n\n## See Also\n\n- [API Shield Docs](https://developers.cloudflare.com/api-shield/)\n- [API Reference](https://developers.cloudflare.com/api/resources/api_gateway/)\n- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)\n\nFile v1.0.0:references/api/README.md\n\n# Cloudflare API Integration\n\nGuide for working with Cloudflare's REST API - authentication, SDK usage, common patterns, and troubleshooting.\n\n## Quick Decision Tree\n\n```\nHow are you calling the Cloudflare API?\n├─ From Workers runtime → Use bindings, not REST API (see ../bindings/)\n├─ Server-side (Node/Python/Go) → Official SDK (see api.md)\n├─ CLI/scripts → Wrangler or curl (see configuration.md)\n├─ Infrastructure-as-code → See ../pulumi/ or ../terraform/\n└─ One-off requests → curl examples (see api.md)\n```\n\n## SDK Selection\n\n| Language | Package | Best For | Default Retries |\n|----------|---------|----------|-----------------|\n| TypeScript | `cloudflare` | Node.js, Bun, Next.js, Workers | 2 |\n| Python | `cloudflare` | FastAPI, Django, scripts | 2 |\n| Go | `cloudflare-go/v4` | CLI tools, microservices | 10 |\n\nAll SDKs are Stainless-generated from OpenAPI spec (consistent APIs).\n\n## Authentication Methods\n\n| Method | Security | Use Case | Scope |\n|--------|----------|----------|-------|\n| **API Token** ✓ | Scoped, rotatable | Production | Per-zone or account |\n| API Key + Email | Full account access | Legacy only | Everything |\n| User Service Key | Limited | Origin CA certs only | Origin CA |\n\n**Always use API tokens** for new projects.\n\n## Rate Limits\n\n| Limit | Value |\n|-------|-------|\n| Per user/token | 1200 requests / 5 minutes |\n| Per IP | 200 requests / second |\n| GraphQL | 320 / 5 minutes (cost-based) |\n\n## Reading Order\n\n| Task | Files to Read |\n|------|---------------|\n| Initialize SDK client | api.md |\n| Configure auth/timeout/retry | configuration.md |\n| Find usage patterns | patterns.md |\n| Debug errors/rate limits | gotchas.md |\n| Product-specific APIs | ../workers/, ../r2/, ../kv/, etc. |\n\n## In This Reference\n\n- **[api.md](api.md)** - SDK client initialization, pagination, error handling, examples\n- **[configuration.md](configuration.md)** - Environment variables, SDK config, Wrangler setup\n- **[patterns.md](patterns.md)** - Real-world patterns, batch operations, workflows\n- **[gotchas.md](gotchas.md)** - Rate limits, SDK-specific issues, troubleshooting\n\n## See Also\n\n- [Cloudflare API Docs](https://developers.cloudflare.com/api/)\n- [Bindings Reference](../bindings/) - Workers runtime bindings (preferred over REST API)\n- [Wrangler Reference](../wrangler/) - CLI tool for Cloudflare development\n\nFile v1.0.0:references/argo-smart-routing/README.md\n\n# Cloudflare Argo Smart Routing Skill Reference\n\n## Overview\n\nCloudflare Argo Smart Routing is a performance optimization service that detects real-time network issues and routes web traffic across the most efficient network path. It continuously monitors network conditions and intelligently routes traffic through the fastest, most reliable routes in Cloudflare's network.\n\n**Note on Smart Shield:** Argo Smart Routing is being integrated into Cloudflare's Smart Shield product for enhanced DDoS protection and performance. Existing Argo customers maintain full functionality with gradual migration to Smart Shield features.\n\n## Quick Start\n\n### Enable via cURL\n```bash\ncurl -X PATCH \"https://api.cloudflare.com/client/v4/zones/{zone_id}/argo/smart_routing\" \\\n  -H \"Authorization: Bearer YOUR_API_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"value\": \"on\"}'\n```\n\n### Enable via TypeScript SDK\n```typescript\nimport Cloudflare from 'cloudflare';\n\nconst client = new Cloudflare({ apiToken: process.env.CLOUDFLARE_API_TOKEN });\n\nconst result = await client.argo.smartRouting.edit({\n  zone_id: 'your-zone-id',\n  value: 'on',\n});\n\nconsole.log(`Argo enabled: ${result.value}`);\n```\n\n## Core Concepts\n\n### What It Does\n- **Intelligent routing**: Detects congestion, outages, packet loss in real-time\n- **Global optimization**: Routes across 300+ Cloudflare data centers\n- **Automatic failover**: Switches paths when issues detected (typically <1s)\n- **Works with existing setup**: No origin changes required\n\n### Billing Model\n- Usage-based: Charged per GB of traffic (excluding DDoS/WAF mitigated traffic)\n- Requires billing configuration before enabling\n- Available on Enterprise+ plans (check zone eligibility)\n\n### When to Use\n- **High-traffic production sites** with global user base\n- **Latency-sensitive applications** (APIs, real-time services)\n- **Sites behind Cloudflare proxy** (orange-clouded DNS records)\n- **Combined with Tiered Cache** for maximum performance gains\n\n### When NOT to Use\n- Development/staging environments (cost control)\n- Low-traffic sites (<1TB/month) where cost may exceed benefit\n- Sites with primarily single-region traffic\n\n## Should I Enable Argo?\n\n| Your Situation | Recommendation |\n|----------------|----------------|\n| Global production app, >1TB/month traffic | ✅ Enable - likely ROI positive |\n| Enterprise plan, latency-critical APIs | ✅ Enable - performance matters |\n| Regional site, <100GB/month traffic | ⚠️ Evaluate - cost may not justify |\n| Development/staging environment | ❌ Disable - use in production only |\n| Not yet configured billing | ❌ Configure billing first |\n\n## Reading Order by Task\n\n| Your Goal | Start With | Then Read |\n|-----------|------------|-----------|\n| Enable Argo for first time | Quick Start above → [configuration.md](configuration.md) | [gotchas.md](gotchas.md) |\n| Use TypeScript/Python SDK | [api.md](api.md) | [patterns.md](patterns.md) |\n| Terraform/IaC setup | [configuration.md](configuration.md) | - |\n| Enable for Spectrum TCP app | [patterns.md](patterns.md) → Spectrum section | [api.md](api.md) |\n| Troubleshoot enablement issue | [gotchas.md](gotchas.md) | [api.md](api.md) |\n| Manage billing/usage | [patterns.md](patterns.md) → Billing section | [gotchas.md](gotchas.md) |\n\n## In This Reference\n\n- **[api.md](api.md)** - API endpoints, SDK methods, error handling, Python/TypeScript examples\n- **[configuration.md](configuration.md)** - Terraform setup, environment config, billing configuration\n- **[patterns.md](patterns.md)** - Tiered Cache integration, Spectrum TCP apps, billing management, validation patterns\n- **[gotchas.md](gotchas.md)** - Common errors, permission issues, limits, best practices\n\n## See Also\n\n- [Cloudflare Argo Smart Routing Docs](https://developers.cloudflare.com/argo-smart-routing/)\n- [Cloudflare Smart Shield](https://developers.cloudflare.com/smart-shield/)\n- [Spectrum Documentation](https://developers.cloudflare.com/spectrum/)\n- [Tiered Cache](https://developers.cloudflare.com/cache/how-to/tiered-cache/)\n\nFile v1.0.0:references/bindings/README.md\n\n# Cloudflare Bindings Skill Reference\n\nExpert guidance on Cloudflare Workers Bindings - the runtime APIs that connect Workers to Cloudflare platform resources.\n\n## What Are Bindings?\n\nBindings are how Workers access Cloudflare resources (storage, compute, services) via the `env` object. They're configured in `wrangler.jsonc`, type-safe via TypeScript, and zero-overhead at runtime.\n\n## Reading Order\n\n1. **This file** - Binding catalog and selection guide\n2. **[api.md](api.md)** - TypeScript types and env access patterns\n3. **[configuration.md](configuration.md)** - Complete wrangler.jsonc examples\n4. **[patterns.md](patterns.md)** - Best practices and common patterns\n5. **[gotchas.md](gotchas.md)** - Critical pitfalls and troubleshooting\n\n## Binding Catalog\n\n### Storage Bindings\n\n| Binding | Use Case | Access Pattern |\n|---------|----------|----------------|\n| **KV** | Key-value cache, CDN-backed reads | `env.MY_KV.get(key)` |\n| **R2** | Object storage (S3-compatible) | `env.MY_BUCKET.get(key)` |\n| **D1** | SQL database (SQLite) | `env.DB.prepare(sql).all()` |\n| **Durable Objects** | Coordination, real-time state | `env.MY_DO.get(id)` |\n| **Vectorize** | Vector embeddings search | `env.VECTORIZE.query(vector)` |\n| **Queues** | Async message processing | `env.MY_QUEUE.send(msg)` |\n\n### Compute Bindings\n\n| Binding | Use Case | Access Pattern |\n|---------|----------|----------------|\n| **Service** | Worker-to-Worker RPC | `env.MY_SERVICE.fetch(req)` |\n| **Workers AI** | LLM inference | `env.AI.run(model, input)` |\n| **Browser Rendering** | Headless Chrome | `env.BROWSER.fetch(url)` |\n\n### Platform Bindings\n\n| Binding | Use Case | Access Pattern |\n|---------|----------|----------------|\n| **Analytics Engine** | Custom metrics | `env.ANALYTICS.writeDataPoint(data)` |\n| **mTLS** | Client certificates | `env.MY_CERT` (string) |\n| **Hyperdrive** | Database pooling | `env.HYPERDRIVE.connectionString` |\n| **Rate Limiting** | Request throttling | `env.RATE_LIMITER.limit(id)` |\n| **Workflows** | Long-running workflows | `env.MY_WORKFLOW.create()` |\n\n### Configuration Bindings\n\n| Binding | Use Case | Access Pattern |\n|---------|----------|----------------|\n| **Environment Variables** | Non-sensitive config | `env.API_URL` (string) |\n| **Secrets** | Sensitive values | `env.API_KEY` (string) |\n| **Text/Data Blobs** | Static files | `env.MY_BLOB` (string) |\n| **WASM** | WebAssembly modules | `env.MY_WASM` (WebAssembly.Module) |\n\n## Quick Selection Guide\n\n**Need persistent storage?**\n- Key-value < 25MB → **KV**\n- Files/objects → **R2**\n- Relational data → **D1**\n- Real-time coordination → **Durable Objects**\n\n**Need AI/compute?**\n- LLM inference → **Workers AI**\n- Scraping/PDFs → **Browser Rendering**\n- Call another Worker → **Service binding**\n\n**Need async processing?**\n- Background jobs → **Queues**\n\n**Need config?**\n- Public values → **Environment Variables**\n- Secrets → **Secrets** (never commit)\n\n## Quick Start\n\n1. **Add binding to wrangler.jsonc:**\n```jsonc\n{\n  \"kv_namespaces\": [\n    { \"binding\": \"MY_KV\", \"id\": \"your-kv-id\" }\n  ]\n}\n```\n\n2. **Generate types:**\n```bash\nnpx wrangler types\n```\n\n3. **Access in Worker:**\n```typescript\nexport default {\n  async fetch(request, env, ctx) {\n    await env.MY_KV.put('key', 'value');\n    return new Response('OK');\n  }\n}\n```\n\n## Type Safety\n\nBindings are fully typed via `wrangler types`. See [api.md](api.md) for details.\n\n## Limits\n\n- 64 bindings max per Worker (all types combined)\n- See [gotchas.md](gotchas.md) for per-binding limits\n\n## Key Concepts\n\n**Zero-overhead access:** Bindings compiled into Worker, no network calls to access\n**Type-safe:** Full TypeScript support via `wrangler types`\n**Per-environment:** Different IDs for dev/staging/production\n**Secrets vs Vars:** Secrets encrypted at rest, never in config files\n\n## See Also\n\n- [Cloudflare Docs: Bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/)\n- [Wrangler Configuration](https://developers.cloudflare.com/workers/wrangler/configuration/)\n\nFile v1.0.0:references/bot-management/README.md\n\n# Cloudflare Bot Management\n\nEnterprise-grade bot detection, protection, and mitigation using ML/heuristics, bot scores, JavaScript detections, and verified bot handling.\n\n## Overview\n\nBot Management provides multi-tier protection:\n- **Free (Bot Fight Mode)**: Auto-blocks definite bots, no config\n- **Pro/Business (Super Bot Fight Mode)**: Configurable actions, static resource protection, analytics groupings\n- **Enterprise (Bot Management)**: Granular 1-99 scores, WAF integration, JA3/JA4 fingerprinting, Workers API, Advanced Analytics\n\n## Quick Start\n\n```txt\n# Dashboard: Security > Bots\n# Enterprise: Deploy rule template\n(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot) → Block\n(cf.bot_management.score le 29 and not cf.bot_management.verified_bot) → Managed Challenge\n```\n\n## What Do You Need?\n\n```txt\n├─ Initial setup → configuration.md\n│   ├─ Free tier → \"Bot Fight Mode\"\n│   ├─ Pro/Business → \"Super Bot Fight Mode\"\n│   └─ Enterprise → \"Bot Management for Enterprise\"\n├─ Workers API integration → api.md\n├─ WAF rules → patterns.md\n├─ Debugging → gotchas.md\n└─ Analytics → api.md#bot-analytics\n```\n\n## Reading Order\n\n| Task | Files to Read |\n|------|---------------|\n| Enable bot protection | README → configuration.md |\n| Workers bot detection | README → api.md |\n| WAF rule templates | README → patterns.md |\n| Debug bot issues | gotchas.md |\n| Advanced analytics | api.md#bot-analytics |\n\n## Core Concepts\n\n**Bot Scores**: 1-99 (1 = definitely automated, 99 = definitely human). Threshold: <30 indicates bot traffic. Enterprise gets granular 1-99; Pro/Business get groupings only.\n\n**Detection Engines**: Heuristics (known fingerprints, assigns score=1), ML (majority of detections, supervised learning on billions of requests), Anomaly Detection (optional, baseline traffic analysis), JavaScript Detections (headless browser detection).\n\n**Verified Bots**: Allowlisted good bots (search engines, AI crawlers) verified via reverse DNS or Web Bot Auth. Access via `cf.bot_management.verified_bot` or `cf.verified_bot_category`.\n\n## Platform Limits\n\n| Plan | Bot Scores | JA3/JA4 | Custom Rules | Analytics Retention |\n|------|------------|---------|--------------|---------------------|\n| Free | No (auto-block only) | No | 5 | N/A (no analytics) |\n| Pro/Business | Groupings only | No | 20/100 | 30 days (72h at a time) |\n| Enterprise | 1-99 granular | Yes | 1,000+ | 30 days (1 week at a time) |\n\n## Basic Patterns\n\n```typescript\n// Workers: Check bot score\nexport default {\n  async fetch(request: Request): Promise<Response> {\n    const botScore = request.cf?.botManagement?.score;\n    if (botScore && botScore < 30 && !request.cf?.botManagement?.verifiedBot) {\n      return new Response('Bot detected', { status: 403 });\n    }\n    return fetch(request);\n  }\n};\n```\n\n```txt\n# WAF: Block definite bots\n(cf.bot_management.score eq 1 and not cf.bot_management.verified_bot)\n\n# WAF: Protect sensitive endpoints\n(cf.bot_management.score lt 50 and http.request.uri.path in {\"/login\" \"/checkout\"} and not cf.bot_management.verified_bot)\n```\n\n## In This Reference\n\n- [configuration.md](./configuration.md) - Product tiers, WAF rule setup, JavaScript Detections, ML auto-updates\n- [api.md](./api.md) - Workers BotManagement interface, WAF fields, JA4 Signals\n- [patterns.md](./patterns.md) - E-commerce, API protection, mobile app allowlisting, SEO-friendly handling\n- [gotchas.md](./gotchas.md) - False positives/negatives, score=0 issues, JSD limitations, CSP requirements\n\n## See Also\n\n- [waf](../waf/) - WAF custom rules for bot enforcement\n- [workers](../workers/) - Workers request.cf.botManagement API\n- [api-shield](../api-shield/) - API-specific bot protection\n\nFile v1.0.0:references/browser-rendering/README.md\n\n# Cloudflare Browser Rendering Skill Reference\n\n**Description**: Expert knowledge for Cloudflare Browser Rendering - control headless Chrome on Cloudflare's global network for browser automation, screenshots, PDFs, web scraping, testing, and content generation.\n\n**When to use**: Any task involving Cloudflare Browser Rendering including: taking screenshots, generating PDFs, web scraping, browser automation, testing web applications, extracting structured data, capturing page metrics, or automating browser interactions.\n\n## Decision Tree\n\n### REST API vs Workers Bindings\n\n**Use REST API when:**\n- One-off, stateless tasks (screenshot, PDF, content fetch)\n- No Workers infrastructure yet\n- Simple integrations from external services\n- Need quick prototyping without deployment\n\n**Use Workers Bindings when:**\n- Complex browser automation workflows\n- Need session reuse for performance\n- Multiple page interactions per request\n- Custom scripting and logic required\n- Building production applications\n\n### Puppeteer vs Playwright\n\n| Feature | Puppeteer | Playwright |\n|---------|-----------|------------|\n| API Style | Chrome DevTools Protocol | High-level abstractions |\n| Selectors | CSS, XPath | CSS, text, role, test-id |\n| Best for | Advanced control, CDP access | Quick automation, testing |\n| Learning curve | Steeper | Gentler |\n\n**Use Puppeteer:** Need CDP protocol access, Chrome-specific features, migration from existing Puppeteer code\n**Use Playwright:** Modern selector APIs, cross-browser patterns, faster development\n\n## Tier Limits Summary\n\n| Limit | Free Tier | Paid Tier |\n|-------|-----------|-----------|\n| Daily browser time | 10 minutes | Unlimited* |\n| Concurrent sessions | 3 | 30 |\n| Requests per minute | 6 | 180 |\n\n*Subject to fair-use policy. See [gotchas.md](gotchas.md) for details.\n\n## Reading Order\n\n**New to Browser Rendering:**\n1. [configuration.md](configuration.md) - Setup and deployment\n2. [patterns.md](patterns.md) - Common use cases with examples\n3. [api.md](api.md) - API reference\n4. [gotchas.md](gotchas.md) - Avoid common pitfalls\n\n**Specific task:**\n- **Setup/deployment** → [configuration.md](configuration.md)\n- **API reference/endpoints** → [api.md](api.md)\n- **Example code/patterns** → [patterns.md](patterns.md)\n- **Debugging/troubleshooting** → [gotchas.md](gotchas.md)\n\n**REST API users:**\n- Start with [api.md](api.md) REST API section\n- Check [gotchas.md](gotchas.md) for rate limits\n\n**Workers users:**\n- Start with [configuration.md](configuration.md)\n- Review [patterns.md](patterns.md) for session management\n- Reference [api.md](api.md) for Workers Bindings\n\n## In This Reference\n\n- **[configuration.md](configuration.md)** - Setup, deployment, wrangler config, compatibility\n- **[api.md](api.md)** - REST API endpoints + Workers Bindings (Puppeteer/Playwright)\n- **[patterns.md](patterns.md)** - Common patterns, use cases, real examples\n- **[gotchas.md](gotchas.md)** - Troubleshooting, best practices, tier limits, common errors\n\n## See Also\n\n- [Cloudflare Docs](https://developers.cloudflare.com/browser-rendering/)\n\nFile v1.0.0:references/c3/README.md\n\n# C3 (create-cloudflare)\n\nOfficial CLI for scaffolding Cloudflare Workers and Pages projects with templates, TypeScript, and instant deployment.\n\n## Quick Start\n\n```bash\n# Interactive (recommended for first-time)\nnpm create cloudflare@latest my-app\n\n# Worker (API/WebSocket/Cron)\nnpm create cloudflare@latest my-api -- --type=hello-world --ts\n\n# Pages (static/SSG/full-stack)\nnpm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages\n```\n\n## Platform Decision Tree\n\n```\nWhat are you building?\n\n├─ API / WebSocket / Cron / Email handler\n│   └─ Workers (default) - no --platform flag needed\n│       npm create cloudflare@latest my-api -- --type=hello-world\n\n├─ Static site / SSG / Documentation\n│   └─ Pages - requires --platform=pages\n│       npm create cloudflare@latest my-site -- --type=web-app --framework=astro --platform=pages\n\n├─ Full-stack app (Next.js/Remix/SvelteKit)\n│   ├─ Need Durable Objects, Queues, or Workers-only features?\n│   │   └─ Workers (default)\n│   └─ Otherwise use Pages for git integration and branch previews\n│       └─ Add --platform=pages\n\n└─ Convert existing project\n    └─ npm create cloudflare@latest . -- --type=pre-existing --existing-script=./src/worker.ts\n```\n\n**Critical:** Pages projects require `--platform=pages` flag. Without it, C3 defaults to Workers.\n\n## Interactive Flow\n\nWhen run without flags, C3 prompts in this order:\n\n1. **Project name** - Directory to create (defaults to current dir with `.`)\n2. **Application type** - `hello-world`, `web-app`, `demo`, `pre-existing`, `remote-template`\n3. **Platform** - `workers` (default) or `pages` (for web apps only)\n4. **Framework** - If web-app: `next`, `remix`, `astro`, `react-router`, `solid`, `svelte`, etc.\n5. **TypeScript** - `yes` (recommended) or `no`\n6. **Git** - Initialize repository? `yes` or `no`\n7. **Deploy** - Deploy now? `yes` or `no` (requires `wrangler login`)\n\n## Installation Methods\n\n```bash\n# NPM\nnpm create cloudflare@latest\n\n# Yarn\nyarn create cloudflare\n\n# PNPM\npnpm create cloudflare@latest\n```\n\n## In This Reference\n\n| File | Purpose | Use When |\n|------|---------|----------|\n| **api.md** | Complete CLI flag reference | Scripting, CI/CD, advanced usage |\n| **configuration.md** | Generated files, bindings, types | Understanding output, customization |\n| **patterns.md** | Workflows, CI/CD, monorepos | Real-world integration |\n| **gotchas.md** | Troubleshooting failures | Deployment blocked, errors |\n\n## Reading Order\n\n| Task | Read |\n|------|------|\n| Create first project | README only |\n| Set up CI/CD | README → api → patterns |\n| Debug failed deploy | gotchas |\n| Understand generated files | configuration |\n| Full CLI reference | api |\n| Create custom template | patterns → configuration |\n| Convert existing project | README → patterns |\n\n## Post-Creation\n\n```bash\ncd my-app\n\n# Local dev with hot reload\nnpm run dev\n\n# Generate TypeScript types for bindings\nnpm run cf-typegen\n\n# Deploy to Cloudflare\nnpm run deploy\n```\n\n## See Also\n\n- **workers/README.md** - Workers runtime, bindings, APIs\n- **workers-ai/README.md** - AI/ML models\n- **pages/README.md** - Pages-specific features\n- **wrangler/README.md** - Wrangler CLI beyond initial setup\n- **d1/README.md** - SQLite database\n- **r2/README.md** - Object storage","readmeExcerpt":"Skill: Cloudflare Deploy Owner: tbeard602 Summary: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-06-07T13:54:49.351Z | auto Initial release of the cloudflare-deploy skill. - Consolidates deployment guidance for Cloudflare Workers, Pages, and related platf","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"npx wrangler whoami    # Shows account if authenticated"},{"language":"text","snippet":"Need to run code?\n├─ Serverless functions at the edge → workers/\n├─ Full-stack web app with Git deploys → pages/\n├─ Stateful coordination/real-time → durable-objects/\n├─ Long-running multi-step jobs → workflows/\n├─ Run containers → containers/\n├─ Multi-tenant (customers deploy code) → workers-for-platforms/\n├─ Scheduled tasks (cron) → cron-triggers/\n├─ Lightweight edge logic (modify HTTP) → snippets/\n├─ Process Worker execution events (logs/observability) → tail-workers/\n└─ Optimize latency to backend infrastructure → smart-placement/"},{"language":"text","snippet":"Need storage?\n├─ Key-value (config, sessions, cache) → kv/\n├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL)\n├─ Object/file storage (S3-compatible) → r2/\n├─ Message queue (async processing) → queues/\n├─ Vector embeddings (AI/semantic search) → vectorize/\n├─ Strongly-consistent per-entity state → durable-objects/ (DO storage)\n├─ Secrets management → secrets-store/\n├─ Streaming ETL to R2 → pipelines/\n└─ Persistent cache (long-term retention) → cache-reserve/"},{"language":"text","snippet":"Need AI?\n├─ Run inference (LLMs, embeddings, images) → workers-ai/\n├─ Vector database for RAG/search → vectorize/\n├─ Build stateful AI agents → agents-sdk/\n├─ Gateway for any AI provider (caching, routing) → ai-gateway/\n└─ AI-powered search widget → ai-search/"},{"language":"text","snippet":"Need networking?\n├─ Expose local service to internet → tunnel/\n├─ TCP/UDP proxy (non-HTTP) → spectrum/\n├─ WebRTC TURN server → turn/\n├─ Private network connectivity → network-interconnect/\n├─ Optimize routing → argo-smart-routing/\n├─ Optimize latency to backend (not user) → smart-placement/\n└─ Real-time video/audio → realtimekit/ or realtime-sfu/"},{"language":"text","snippet":"Need security?\n├─ Web Application Firewall → waf/\n├─ DDoS protection → ddos/\n├─ Bot detection/management → bot-management/\n├─ API protection → api-shield/\n├─ CAPTCHA alternative → turnstile/\n└─ Credential leak detection → waf/ (managed ruleset)"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: cloudflare-deploy\ndescription: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or set up a project on Cloudflare.\n---\n\n# Cloudflare Deploy\n\nConsolidated skill for building on the Cloudflare platform. Use decision trees below to find the right product, then load detailed references.\n\n## Prerequisites\n\n- When sandboxing blocks the deployment network calls, rerun with `sandbox_permissions=require_escalated`.\n- The deployment might take a few minutes. Use appropriate timeout values.\n\n## Authentication (Required Before Deploy)\n\nVerify auth before `wrangler deploy`, `wrangler pages deploy`, or `npm run deploy`:\n\n```bash\nnpx wrangler whoami    # Shows account if authenticated\n```\n\nNot authenticated? → `references/wrangler/auth.md`\n- Interactive/local: `wrangler login` (one-time OAuth)\n- CI/CD: Set `CLOUDFLARE_API_TOKEN` env var\n\n## Quick Decision Trees\n\n### \"I need to run code\"\n\n```\nNeed to run code?\n├─ Serverless functions at the edge → workers/\n├─ Full-stack web app with Git deploys → pages/\n├─ Stateful coordination/real-time → durable-objects/\n├─ Long-running multi-step jobs → workflows/\n├─ Run containers → containers/\n├─ Multi-tenant (customers deploy code) → workers-for-platforms/\n├─ Scheduled tasks (cron) → cron-triggers/\n├─ Lightweight edge logic (modify HTTP) → snippets/\n├─ Process Worker execution events (logs/observability) → tail-workers/\n└─ Optimize latency to backend infrastructure → smart-placement/\n```\n\n### \"I need to store data\"\n\n```\nNeed storage?\n├─ Key-value (config, sessions, cache) → kv/\n├─ Relational SQL → d1/ (SQLite) or hyperdrive/ (existing Postgres/MySQL)\n├─ Object/file storage (S3-compatible) → r2/\n├─ Message queue (async processing) → queues/\n├─ Vector embeddings (AI/semantic search) → vectorize/\n├─ Strongly-consistent per-entity state → durable-objects/ (DO storage)\n├─ Secrets management → secrets-store/\n├─ Streaming ETL to R2 → pipelines/\n└─ Persistent cache (long-term retention) → cache-reserve/\n```\n\n### \"I need AI/ML\"\n\n```\nNeed AI?\n├─ Run inference (LLMs, embeddings, images) → workers-ai/\n├─ Vector database for RAG/search → vectorize/\n├─ Build stateful AI agents → agents-sdk/\n├─ Gateway for any AI provider (caching, routing) → ai-gateway/\n└─ AI-powered search widget → ai-search/\n```\n\n### \"I need networking/connectivity\"\n\n```\nNeed networking?\n├─ Expose local service to internet → tunnel/\n├─ TCP/UDP proxy (non-HTTP) → spectrum/\n├─ WebRTC TURN server → turn/\n├─ Private network connectivity → network-interconnect/\n├─ Optimize routing → argo-smart-routing/\n├─ Optimize latency to backend (not user) → smart-placement/\n└─ Real-time video/audio → realtimekit/ or realtime-sfu/\n```\n\n### \"I need security\"\n\n```\nNeed security?\n├─ Web Application Firewall → waf/\n├─ DDoS protection → ddos/\n├─ Bot detection/management → bot-management/\n├─ API protection → api-shield/\n├─ CAPTCHA alternative → turnstile/\n└─ Credential leak det"},{"path":"references/agents-sdk/README.md","content":"# Cloudflare Agents SDK\n\nCloudflare Agents SDK enables building AI-powered agents on Durable Objects with state, WebSockets, SQL, scheduling, and AI integration.\n\n## Core Value\nBuild stateful, globally distributed AI agents with persistent memory, real-time connections, scheduled tasks, and async workflows.\n\n## When to Use\n- Persistent state + memory required\n- Real-time WebSocket connections\n- Long-running workflows (minutes/hours)\n- Chat interfaces with AI models\n- Scheduled/recurring tasks with state\n- DB queries with agent state\n\n## What Type of Agent?\n\n| Use Case | Class | Key Features |\n|----------|-------|--------------|\n| AI chat interface | `AIChatAgent` | Auto-streaming, tools, message history, resumable |\n| MCP tool provider | `Agent` + MCP | Expose tools to AI systems |\n| Custom logic/routing | `Agent` | Full control, WebSockets, email, SQL |\n| Real-time collaboration | `Agent` | WebSocket state, broadcasts |\n| Email processing | `Agent` | `onEmail()` handler |\n\n## Quick Start\n\n**AI Chat Agent:**\n```typescript\nimport { AIChatAgent } from \"agents\";\nimport { openai } from \"@ai-sdk/openai\";\n\nexport class ChatAgent extends AIChatAgent<Env> {\n  async onChatMessage(onFinish) {\n    return this.streamText({\n      model: openai(\"gpt-4\"),\n      messages: this.messages,\n      onFinish,\n    });\n  }\n}\n```\n\n**Base Agent:**\n```typescript\nimport { Agent } from \"agents\";\n\nexport class MyAgent extends Agent<Env> {\n  onStart() {\n    this.sql`CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY)`;\n  }\n  \n  async onRequest(request: Request) {\n    return Response.json({ state: this.state });\n  }\n}\n```\n\n## Reading Order\n\n| Task | Files to Read |\n|------|---------------|\n| Quick start | README only |\n| Build chat agent | README → api.md (AIChatAgent) → patterns.md |\n| Setup project | README → configuration.md |\n| Add React frontend | README → api.md (Client Hooks) → patterns.md |\n| Build MCP server | api.md (MCP) → patterns.md |\n| Background tasks | api.md (Scheduling, Task Queue) → patterns.md |\n| Debug issues | gotchas.md |\n\n## Package Entry Points\n\n| Import | Purpose |\n|--------|---------|\n| `agents` | Server-side Agent classes, lifecycle |\n| `agents/react` | `useAgent()` hook for WebSocket connections |\n| `agents/ai-react` | `useAgentChat()` hook for AI chat UIs |\n\n## In This Reference\n- [configuration.md](./configuration.md) - SDK setup, wrangler config, routing\n- [api.md](./api.md) - Agent classes, lifecycle, client hooks\n- [patterns.md](./patterns.md) - Common workflows, best practices\n- [gotchas.md](./gotchas.md) - Common issues, limits\n\n## See Also\n- durable-objects - Agent infrastructure\n- d1 - External database integration\n- workers-ai - AI model integration\n- vectorize - Vector search for RAG patterns"},{"path":"references/ai-gateway/README.md","content":"# Cloudflare AI Gateway\n\nExpert guidance for implementing Cloudflare AI Gateway - a universal gateway for AI model providers with analytics, caching, rate limiting, and routing capabilities.\n\n## When to Use This Reference\n\n- Setting up AI Gateway for any AI provider (OpenAI, Anthropic, Workers AI, etc.)\n- Implementing caching, rate limiting, or request retry/fallback\n- Configuring dynamic routing with A/B testing or model fallbacks\n- Managing provider API keys securely with BYOK\n- Adding security features (guardrails, DLP)\n- Setting up observability with logging and custom metadata\n- Debugging AI Gateway requests or optimizing configurations\n\n## Quick Start\n\n**What's your setup?**\n\n- **Using Vercel AI SDK** → Pattern 1 (recommended) - see [sdk-integration.md](./sdk-integration.md)\n- **Using OpenAI SDK** → Pattern 2 - see [sdk-integration.md](./sdk-integration.md)\n- **Cloudflare Worker + Workers AI** → Pattern 3 - see [sdk-integration.md](./sdk-integration.md)\n- **Direct HTTP (any language)** → Pattern 4 - see [configuration.md](./configuration.md)\n- **Framework (LangChain, etc.)** → See [sdk-integration.md](./sdk-integration.md)\n\n## Pattern 1: Vercel AI SDK (Recommended)\n\nMost modern pattern using official `ai-gateway-provider` package with automatic fallbacks.\n\n```typescript\nimport { createAiGateway } from 'ai-gateway-provider';\nimport { createOpenAI } from '@ai-sdk/openai';\nimport { generateText } from 'ai';\n\nconst gateway = createAiGateway({\n  accountId: process.env.CF_ACCOUNT_ID,\n  gateway: process.env.CF_GATEWAY_ID,\n});\n\nconst openai = createOpenAI({ \n  apiKey: process.env.OPENAI_API_KEY \n});\n\n// Single model\nconst { text } = await generateText({\n  model: gateway(openai('gpt-4o')),\n  prompt: 'Hello'\n});\n\n// Automatic fallback array\nconst { text } = await generateText({\n  model: gateway([\n    openai('gpt-4o'),              // Try first\n    anthropic('claude-sonnet-4-5'), // Fallback\n  ]),\n  prompt: 'Hello'\n});\n```\n\n**Install:** `npm install ai-gateway-provider ai @ai-sdk/openai @ai-sdk/anthropic`\n\n## Pattern 2: OpenAI SDK\n\nDrop-in replacement for OpenAI API with multi-provider support.\n\n```typescript\nimport OpenAI from 'openai';\n\nconst client = new OpenAI({\n  apiKey: process.env.OPENAI_API_KEY,\n  baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/compat`,\n  defaultHeaders: {\n    'cf-aig-authorization': `Bearer ${cfToken}` // For authenticated gateways\n  }\n});\n\n// Switch providers by changing model format: {provider}/{model}\nconst response = await client.chat.completions.create({\n  model: 'openai/gpt-4o', // or 'anthropic/claude-sonnet-4-5'\n  messages: [{ role: 'user', content: 'Hello!' }]\n});\n```\n\n## Pattern 3: Workers AI Binding\n\nFor Cloudflare Workers using Workers AI.\n\n```typescript\nexport default {\n  async fetch(request, env, ctx) {\n    const response = await env.AI.run(\n      '@cf/meta/llama-3-8b-instruct',\n      { messages: [{ role: 'user', content: 'Hello!' }] },\n      { \n        gateway: { \n          id: 'my-gate"},{"path":"references/ai-search/README.md","content":"# Cloudflare AI Search Reference\n\nExpert guidance for implementing Cloudflare AI Search (formerly AutoRAG), Cloudflare's managed semantic search and RAG service.\n\n## Overview\n\n**AI Search** is a managed RAG (Retrieval-Augmented Generation) pipeline that combines:\n- Automatic semantic indexing of your content\n- Vector similarity search\n- Built-in LLM generation\n\n**Key value propositions:**\n- **Zero vector management** - No manual embedding, indexing, or storage\n- **Auto-indexing** - Content automatically re-indexed every 6 hours\n- **Built-in generation** - Optional AI response generation from retrieved context\n- **Multi-source** - Index from R2 buckets or website crawls\n\n**Data source options:**\n- **R2 bucket** - Index files from Cloudflare R2 (supports MD, TXT, HTML, PDF, DOC, CSV, JSON)\n- **Website** - Crawl and index website content (requires Cloudflare-hosted domain)\n\n**Indexing lifecycle:**\n- Automatic 6-hour refresh cycle\n- Manual \"Force Sync\" available (30s rate limit)\n- Not designed for real-time updates\n\n## Quick Start\n\n**1. Create AI Search instance in dashboard:**\n- Go to Cloudflare Dashboard → AI Search → Create\n- Choose data source (R2 or website)\n- Configure instance name and settings\n\n**2. Configure Worker:**\n\n```jsonc\n// wrangler.jsonc\n{\n  \"ai\": {\n    \"binding\": \"AI\"\n  }\n}\n```\n\n**3. Use in Worker:**\n\n```typescript\nexport default {\n  async fetch(request, env) {\n    const answer = await env.AI.autorag(\"my-search-instance\").aiSearch({\n      query: \"How do I configure caching?\",\n      model: \"@cf/meta/llama-3.3-70b-instruct-fp8-fast\"\n    });\n    \n    return Response.json({ answer: answer.response });\n  }\n};\n```\n\n## When to Use AI Search\n\n### AI Search vs Vectorize\n\n| Factor | AI Search | Vectorize |\n|--------|-----------|-----------|\n| **Management** | Fully managed | Manual embedding + indexing |\n| **Use when** | Want zero-ops RAG pipeline | Need custom embeddings/control |\n| **Indexing** | Automatic (6hr cycle) | Manual via API |\n| **Generation** | Built-in optional | Bring your own LLM |\n| **Data sources** | R2 or website | Manual insert |\n| **Best for** | Docs, support, enterprise search | Custom ML pipelines, real-time |\n\n### AI Search vs Direct Workers AI\n\n| Factor | AI Search | Workers AI (direct) |\n|--------|-----------|---------------------|\n| **Context** | Automatic retrieval | Manual context building |\n| **Use when** | Need RAG (search + generate) | Simple generation tasks |\n| **Indexing** | Built-in | Not applicable |\n| **Best for** | Knowledge bases, docs | Simple chat, transformations |\n\n### search() vs aiSearch()\n\n| Method | Returns | Use When |\n|--------|---------|----------|\n| `search()` | Search results only | Building custom UI, need raw chunks |\n| `aiSearch()` | AI response + results | Need ready-to-use answer (chatbot, Q&A) |\n\n### Real-time Updates Consideration\n\n**AI Search is NOT ideal if:**\n- Need real-time content updates (<6 hours)\n- Content changes multiple times per hour\n- Strict freshness requirements\n\n**AI"},{"path":"references/analytics-engine/README.md","content":"# Cloudflare Workers Analytics Engine Reference\n\nExpert guidance for implementing unlimited-cardinality analytics at scale using Cloudflare Workers Analytics Engine.\n\n## What is Analytics Engine?\n\nTime-series analytics database designed for high-cardinality data (millions of unique dimensions). Write data points from Workers, query via SQL API. Use for:\n- Custom user-facing analytics dashboards\n- Usage-based billing & metering\n- Per-customer/per-feature monitoring\n- High-frequency instrumentation without performance impact\n\n**Key Capability:** Track metrics with unlimited unique values (e.g., millions of user IDs, API keys) without performance degradation.\n\n## Core Concepts\n\n| Concept | Description | Example |\n|---------|-------------|---------|\n| **Dataset** | Logical table for related metrics | `api_requests`, `user_events` |\n| **Data Point** | Single measurement with timestamp | One API request's metrics |\n| **Blobs** | String dimensions (max 20) | endpoint, method, status, user_id |\n| **Doubles** | Numeric values (max 20) | latency_ms, request_count, bytes |\n| **Indexes** | Filtered blobs for efficient queries | customer_id, api_key |\n\n## Reading Order\n\n| Task | Start Here | Then Read |\n|------|------------|-----------|\n| **First-time setup** | [configuration.md](configuration.md) → [api.md](api.md) → [patterns.md](patterns.md) | |\n| **Writing data** | [api.md](api.md) → [gotchas.md](gotchas.md) (sampling) | |\n| **Querying data** | [api.md](api.md) (SQL API) → [patterns.md](patterns.md) (examples) | |\n| **Debugging** | [gotchas.md](gotchas.md) → [api.md](api.md) (limits) | |\n| **Optimization** | [patterns.md](patterns.md) (anti-patterns) → [gotchas.md](gotchas.md) | |\n\n## When to Use Analytics Engine\n\n```\nNeed to track metrics? → Yes\n  ↓\nMillions of unique dimension values? → Yes\n    ↓\n  Need real-time queries? → Yes\n      ↓\n    Use Analytics Engine ✓\n\nAlternative scenarios:\n- Low cardinality (<10k unique values) → Workers Analytics (free tier)\n- Complex joins/relations → D1 Database\n- Logs/debugging → Tail Workers (logpush)\n- External tools → Send to external analytics (Datadog, etc.)\n```\n\n## Quick Start\n\n1. Add binding to `wrangler.jsonc`:\n```jsonc\n{\n  \"analytics_engine_datasets\": [\n    { \"binding\": \"ANALYTICS\", \"dataset\": \"my_events\" }\n  ]\n}\n```\n\n2. Write data points (fire-and-forget, no await):\n```typescript\nenv.ANALYTICS.writeDataPoint({\n  blobs: [\"/api/users\", \"GET\", \"200\"],\n  doubles: [145.2, 1],  // latency_ms, count\n  indexes: [customerId]\n});\n```\n\n3. Query via SQL API (HTTP):\n```sql\nSELECT blob1, SUM(double2) AS total_requests\nFROM my_events\nWHERE index1 = 'customer_123'\n  AND timestamp >= NOW() - INTERVAL '7' DAY\nGROUP BY blob1\nORDER BY total_requests DESC\n```\n\n## In This Reference\n\n- **[configuration.md](configuration.md)** - Setup, bindings, TypeScript types, limits\n- **[api.md](api.md)** - `writeDataPoint()`, SQL API, query syntax\n- **[patterns.md](patterns.md)** - Use cases, examples, anti-patterns\n- **[gotchas.md](gotchas.md)*"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or... Skill: Cloudflare Deploy Owner: tbeard602 Summary: Deploy applications and infrastructure to Cloudflare using Workers, Pages, and related platform services. Use when the user asks to deploy, host, publish, or... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-06-07T13:54:49.351Z | auto Initial release of the cloudflare-deploy skill. - Consolidates deployment guidance for Cloudflare Workers, Pages, and related platf","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1366,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T14:00:41.712Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T17:41:20.789Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}