Cloudflare Workers AI
by developers.cloudflare.com
AI models and chat
Added on October 31st, 2026
Checked and working on October 31st, 2026
Visit developers.cloudflare.com →
What it does
Workers AI runs open AI models on Cloudflare's global network: text generation and chat, text embeddings, image generation, image classification, speech recognition, translation and summarisation. Call the models from a Cloudflare Worker or over the REST API with an API token. Responses are JSON. The Workers Free plan includes 10,000 'neurons' (Cloudflare's unit of AI compute) per day; requests above that fail until the daily reset, unless you move to the paid plan. Cloudflare's official MCP server at https://mcp.cloudflare.com/mcp lets AI agents use the Cloudflare API, Workers AI included.
At a glance
- API key
- Needed, free · More APIs with a free key
- Pricing
- The Workers Free plan includes 10,000 'neurons' (Cloudflare's unit of AI compute) per day; requests above that fail until the daily reset, unless you move to the paid plan.
- Formats
- JSON
- Interface
- REST, MCP
- Provider
- developers.cloudflare.com
- Last checked
- Working on October 31st, 2026
More information: https://developers.cloudflare.com/workers-ai/
Used in: Build a chatbot on free AI API tiers
Is this your service? Show that it is listed
Put this badge on your website or in your README; it links to this page. About the badge
Example request
curl
curl -X POST 'https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/run/@cf/meta/llama-3.1-8b-instruct' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"prompt": "hello"}'
JavaScript
const response = await fetch("https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/run/@cf/meta/llama-3.1-8b-instruct", {
method: 'POST',
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({"prompt":"hello"}),
});
const data = await response.json();
console.log(data);
Python
import requests
response = requests.post(
"https://api.cloudflare.com/client/v4/accounts/YOUR_ACCOUNT_ID/ai/run/@cf/meta/llama-3.1-8b-instruct",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"prompt": "hello",
},
timeout=30,
)
print(response.json())
Replace YOUR_API_KEY with your own key.