How to Connect Cloudflare to an AI Agent
Auth setup
1. Go to dash.cloudflare.com/profile/api-tokens. 2. Create token with specific permissions (e.g., Zone:DNS:Edit). 3. Use Authorization: Bearer {token}. 4. Legacy: X-Auth-Email + X-Auth-Key headers (not recommended).
Key facts
| Base URL | https://api.cloudflare.com/client/v4/ |
| API version | v4 |
| Auth | API token (recommended) or API key + email. Tokens are scoped and more secure. Pass as Bearer token in Authorization header. |
| Request body | application/json |
| Pagination | page + per_page parameters. Response includes result_info: {page, per_page, total_count, total_pages}. |
| Rate limit | 1,200 req/5min globally. Some endpoints lower (e.g., Workers: 1,000/min). |
| Error format | JSON: {"success":false,"errors":[{"code":1003,"message":"..."}],"messages":[],"result":null} |
Key endpoints
| Method | Path | Description |
GET | /zones | List zones (domains) |
GET | /zones/{id}/dns_records | List DNS records for a zone |
POST | /zones/{id}/dns_records | Create DNS record |
PUT | /zones/{id}/settings/ssl | Update SSL/TLS settings |
POST | /accounts/{id}/workers/scripts/{name} | Deploy Workers script |
Quickstart
GET /client/v4/zones
Authorization: Bearer {api_token}
Content-Type: application/json
Response: {"success":true,"result":[{"id":"...","name":"example.com",...}]}
Agent pitfalls & tips
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
- [object Object]
Source: curated by KanseiLink from official documentation (docs) and registry checks. Last reviewed: 2026-06-08. Specs change — verify against the official docs before production use.
Frequently Asked Questions
What is Cloudflare's AEO score?
▼
Cloudflare has an AEO score of 0.90 and is rated AA (Strong agent support with minor gaps). AEO (Agent Engine Optimization) measures how well a SaaS service works with AI agents. Scores range from 0.00 to 1.00, with grades from AAA (best) to D (not agent-ready).
Is Cloudflare AI-agent-ready?
▼
Cloudflare is currently ✓ verified for AI agent use. It offers an official MCP (Model Context Protocol) server, which means AI agents can connect directly. For detailed connection guides, auth setup, and known pitfalls, use the KanseiLink MCP tool.
How does Cloudflare compare to other DevOps services?
▼
In the DevOps category, Cloudflare is rated AA. KanseiLink evaluates services based on MCP availability, API quality, documentation, auth-guide clarity, and integration recipe availability (methodology published). Visit the full rankings at kansei-link.com to see how Cloudflare compares.
How can I integrate Cloudflare with an AI agent?
▼
The fastest way to integrate Cloudflare with an AI agent is through KanseiLink MCP. Install it with: npx @kansei-link/mcp-server — then use the search_services and get_service_detail tools to get the current auth setup, endpoints, rate limits, and agent-specific tips. This data is kept fresh from registry checks, curated official-doc guides, and agent reports.
How do I authenticate with Cloudflare?
▼
API token (recommended) or API key + email. Tokens are scoped and more secure. Pass as Bearer token in Authorization header. Setup: 1. Go to dash.cloudflare.com/profile/api-tokens. 2. Create token with specific permissions (e.g., Zone:DNS:Edit). 3. Use Authorization: Bearer {token}. 4. Legacy: X-Auth-Email + X-Auth-Key headers (not recommended).
What are Cloudflare's API rate limits?
▼
1,200 req/5min globally. Some endpoints lower (e.g., Workers: 1,000/min).