cloudflare-api

cloudflare-api is a skill for Claude Code from jezweb/claude-skills. It costs 141 tokens per session (4,082 once invoked), scanned A, original, MIT.

A way to call Cloudflare's REST API directly for operations that are awkward or unavailable through Wrangler, Cloudflare's command-line tool, or connected management tools. It is intended especially for bulk and fleet-wide changes.

In plain words
What is it for?
Use it for bulk DNS or redirect updates, custom hostnames, email routing, security rules, cache purges, zone settings, Worker routes, cross-database D1 work, and bulk R2 or KV operations.
Why use it?
It avoids handling many records, zones, databases, or objects one at a time and exposes Cloudflare operations that other interfaces may not cover well.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the cloudflare plugin — 8 skills, 8 commands shipped together

Install

Getting it into your agent

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

agentmods
npx agentmods add skills/jezweb/claude-skills/cloudflare-api
Any agent
npx skills add jezweb/claude-skills --skill cloudflare-api
Clone the repo
git clone --depth 1 https://github.com/jezweb/claude-skills

Made for: Claude Code.

Or install cloudflare, the plugin that ships this one along with the rest of its 8 skills, 8 commands.

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 cloudflare-api

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

What it costs to keep this loaded

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

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.04082
Opus 5 $0.00071 $0.02041
Sonnet 5 $0.00028 $0.00816
Haiku 4.5 $0.00014 $0.00408

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

Security

Grade A, and why

cloudflare-api 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.

description: "Hit the Cloudflare REST API directly for operations that wrangler and MCP can't handle well. Bulk DNS, custom hostnames, email routing, cache purge, WAF rules, redirect rules, zone settings, Worker routes,
plugins/cloudflare/skills/cloudflare-api/SKILL.md · 399 lines

How it starts

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

Cloudflare API

Hit the Cloudflare REST API directly when wrangler CLI or MCP servers aren't the right tool. For bulk operations, fleet-wide changes, and features that wrangler doesn't expose.

When to Use This Instead of Wrangler or MCP

Use case Wrangler MCP This skill
Deploy a Worker Yes Yes No
Create a D1 database Yes Yes No
Bulk update 50 DNS records Slow (one at a time) Slow (one tool call each) Yes — batch script
Custom hostnames for white-label No Partial Yes
Email routing rules No Partial Yes
WAF/firewall rules No Yes but verbose Yes — direct API
Redirect rules in bulk No One at a time Yes — batch script
Zone settings across 20 zones No 20 separate calls Yes — fleet script
Cache purge by tag/prefix No Yes Yes (when scripting)
Worker route management Limited Yes Yes (when bulk)
Analytics/logs query No Partial Yes — GraphQL
D1 query/export across databases One DB at a time One DB at a time Yes — cross-DB scripts
R2 bulk object operations No One at a time Yes — S3 API + batch
KV bulk read/write/delete One at a time One at a time Yes — bulk endpoints
Vectorize query/delete No Via Worker only Yes — direct API
Queue message injection No Via Worker only Yes — direct API
Audit all resources in account No Tedious Yes — inventory script

Rule of thumb: Single operations → MCP or wrangler. Bulk/fleet/scripted → API directly.

Auth Setup

API Token (recommended)

Create a scoped token at: Dashboard → My Profile → API Tokens → Create Token

# Store it
export CLOUDFLARE_API_TOKEN="your-token-here"

# Test it
curl -s "https://api.cloudflare.com/client/v4/user/tokens/verify" \
  -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" | jq '.success'

Token scopes: Always use minimal permissions. Common presets:

  • "Edit zone DNS" — for DNS operations
  • "Edit zone settings" — for zone config changes
  • "Edit Cloudflare Workers" — for Worker route management
  • "Read analytics" — for GraphQL analytics

Read the full file on GitHub · 399 lines

Files

What ships with it

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

Changes

What this file has done since we first saw it

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

  1. 6d ago First seen · 399 lines · 141 tokens per session scan A dc3d409785ee

Subscribe to this mod's changes

cloudflare-api is a skill published in the GitHub repository jezweb/claude-skills (995 stars, last pushed 2mo ago), licensed MIT. It adds 141 tokens to every session and 4,082 once invoked, about $0.0007 per session on Opus 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-08-30.

Related

Other skills, from other repositories

cloudflare-hardening

Harden a site behind Cloudflare end-to-end, from account to zone to origin. Covers DNS hygiene, origin-IP protection via Authenticated Origin Pulls and IP allowlisting, WAF managed rules, Bot Fight Mode, rate limiting, Transform Rules for security headers, Zero Trust Access for admin paths, and R2 / Pages security.…

GoldenWing-360/claude-security-skills · 92 tokens

vps-hardening

Baseline-harden a Debian or Ubuntu VPS in roughly thirty minutes. Covers SSH key-only authentication, UFW firewall, fail2ban with web-app jails, unattended security upgrades, kernel sysctls, journalctl retention, and sudo policy. Invoke when provisioning a new VPS, inheriting one without documented hardening, or…

GoldenWing-360/claude-security-skills · 79 tokens

site-server-audit

Audit a public-facing site or server for common misconfigurations without sending exploit traffic. Covers DNS hygiene, TLS and HSTS, security headers, exposed paths (.git, .env, backups), cookie flags, and software fingerprinting. Invoke when onboarding a new client site, before launch, after infrastructure changes…

GoldenWing-360/claude-security-skills · 74 tokens

backup-disaster-recovery

Design backups that actually work when they are needed. Covers RPO and RTO definition, the 3-2-1 rule, encryption before leaving the host, ransomware-resistant immutable storage, restore drills, and the split between operational and legal retention. Invoke when 'we have backups but nobody has restored them' is true…

GoldenWing-360/claude-security-skills · 83 tokens

latchbio-integration

Build, register, debug, and operate bioinformatics workflows on Latch using the Python SDK, CLI, Latch Data and Registry, Nextflow, Snakemake, programmatic execution, and Latch MCP. Use when authoring or deploying Latch workflows, configuring resources or interfaces, moving data, integrating Registry, or launching and…

K-Dense-AI/scientific-agent-skills · 76 tokens

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from…

cloudflare/skills · 72 tokens