cloudflare-images
БесплатноБез исполняемых скриптовНе проверенCloudflare Images, covering both the Images API for upload and storage and Image Transformations for optimizing any publicly accessible image. Includes…
Об этом скилле
Cloudflare Images
Status: Production Ready ✅ Last Updated: 2025-10-26 Dependencies: Cloudflare account with Images enabled Latest Versions: Cloudflare Images API v2
Overview
Cloudflare Images provides two powerful features:
- Images API: Upload, store, and serve images with automatic optimization and variants
- Image Transformations: Resize, optimize, and transform any publicly accessible image
Key Benefits:
- Global CDN delivery
- Automatic WebP/AVIF conversion
- Variants for different use cases (up to 100)
- Direct creator upload (user uploads without API keys)
- Signed URLs for private images
- Transform any image via URL or Workers
Quick Start (5 Minutes)
1. Enable Cloudflare Images
Log into Cloudflare dashboard → Images → Enable for your account.
Get your Account ID and create an API token with Cloudflare Images: Edit permissions.
Why this matters:
- Account ID and API token are required for all API operations
- Images Free plan includes limited transformations
2. Upload Your First Image
curl --request POST \
--url https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/images/v1 \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@./image.jpg'
Response includes:
id: Image ID for servingvariants: Array of delivery URLs
CRITICAL:
- Use
multipart/form-dataencoding (NOTapplication/json) - Image ID is automatically generated (or use custom ID)
3. Serve the Image
<img src="https://imagedelivery.net/<ACCOUNT_HASH>/<IMAGE_ID>/public" />
Default public variant serves the image. Replace with your own variant names.
4. Enable Image Transformations
Dashboard → Images → Transformations → Select your zone → Enable for zone
Now you can transform ANY image:
<img src="/cdn-cgi/image/width=800,quality=85/uploads/photo.jpg" />
Why this matters:
- Works on images stored OUTSIDE Cloudflare Images
- Automatic caching on Cloudflare's global network
- No additional storage costs
5. Transform via Workers (Advanced)
export default {
async fetch(request: Request): Promise<Response> {
const imageURL = "https://example.com/image.jpg";
return fetch(imageURL, {
cf: {
image: {
width: 800,
quality: 85,
format: "auto" // WebP/AVIF for supporting browsers
}
}
});
}
};
The 3-Feature System
Feature 1: Images API (Upload & Storage)
Store images on Cloudflare's network and serve them globally.
Upload Methods:
- File Upload - Upload files directly from your server
- Upload via URL - Ingest images from external URLs
- Direct Creator Upload - Generate one-time upload URLs for user uploads
Serving Options:
- Default domain:
imagedelivery.net - Custom domains:
/cdn-cgi/imagedelivery/... - Signed URLs: Private images with expiry tokens
See: templates/upload-api-basic.ts, templates/direct-creator-upload-backend.ts
Feature 2: Image Transformations
Optimize and resize ANY image (stored in Images or external).
Two Methods:
- URL Transformations - Special URL format
- Workers Transformations - Programmatic control via fetch
Common Transformations:
- Resize:
width=800,height=600,fit=cover - Optimize:
quality=85,format=auto - Effects:
blur=10,sharpen=3 - Crop:
gravity=face,zoom=0.5
See: templates/transform-via-url.ts, templates/transform-via-workers.ts
Feature 3: Variants
Predefined image sizes for different use cases.
Named Variants (up to 100):
- Create once, use everywhere
- Example:
thumbnail,avatar,hero - Consistent transformations
Flexible Variants (dynamic):
- Enable per account
- Use transformation params in URL
- Example:
w=400,sharpen=3 - Cannot use with signed URLs
See: templates/variants-management.ts, references/variants-guide.md
Images API - Upload Methods
Method 1: File Upload (Basic)
curl --request POST \
https://api.cloudflare.com/client/v4/accounts/{account_id}/images/v1 \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: multipart/form-data" \
--form 'file=@./image.jpg' \
--form 'requireSignedURLs=false' \
--form 'metadata={"key":"value"}'
Key Options:
file: Image file (required)id: Custom ID (optional, default auto-generated)requireSignedURLs:truefor private images (default:false)metadata: JSON object (max 1024 bytes, not visible to end users)
Response:
{
"result": {
"id": "2cdc28f0-017a-49c4-9ed7-87056c83901",
"filename": "image.jpg",
"uploaded": "2022-01-31T16:39:28.458Z",
"requireSignedURLs": false,
"variants": [
"https://imagedelivery.net/Vi7wi5KSItxGFsWRG2Us6Q/2cdc28f0.../public"
]
}
}
See: `templates/upload-api-basic.t
Установить cloudflare-images в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл cloudflare-images?
Cloudflare Images, covering both the Images API for upload and storage and Image Transformations for optimizing any publicly accessible image. Includes account setup and API tokens, multipart uploads, direct creator uploads for end users, named and flexible variants, signed URLs for private images, imagedelivery.net delivery, /cdn-cgi/image/ URL transforms, and cf.image options from a Worker, plus automatic WebP and AVIF conversion for responsive images. Use when adding image upload or storage to a project, resizing or reformatting images via URL or Workers, building an image CDN or responsive image pipeline, managing variants, generating signed URLs, or debugging CORS failures on direct creator uploads and transformation errors such as 5408, 9401, and 9403.
Как установить скилл cloudflare-images?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл cloudflare-images запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic