Pick Cloudflare API token permissions like Zone DNS Edit or Workers Edit, scope them to accounts and zones, and let agents use the token without seeing it.
OneCLI connects AI agents to Cloudflare so they can deploy Workers, manage DNS records, read and write KV namespaces, query D1 databases, deploy Pages sites, and interact with the full Cloudflare API. The gateway injects your API token into requests automatically.
Go to the Cloudflare dashboard and click Create Token.Choose a template or create a custom token with the permissions your agents need. Common templates:
Template
Permissions
Use case
Edit Cloudflare Workers
Workers Scripts: Edit, Workers Routes: Edit
Deploying and managing Workers
Edit zone DNS
DNS: Edit
Managing DNS records
Read All Resources
All zones and accounts: Read
Auditing, monitoring
Custom
You choose
Fine-grained access
API tokens can be scoped to specific accounts and zones, so you can restrict what your agents can access.
2
Connect in OneCLI
Open the OneCLI dashboard, go to Connections > Cloudflare, and paste your API token.
Create the narrowest token that covers your agents’ needs. For example, if agents only deploy Workers, use the “Edit Cloudflare Workers” template instead of a broad-access token.
Cloudflare enforces a global rate limit of 1,200 requests per 5-minute window per user. This applies across dashboard, API key, and API token usage combined. Use OneCLI rules to rate-limit agent requests if you need to stay well within this budget.