Cloudflare Workers AI runs inference at whichever Cloudflare location is closest to your users, so you get low-latency AI without managing GPUs. Added to the free tier in 2024, it's one of the few platforms where you can run real models — including image generation and Whisper transcription — at zero cost for prototypes and small projects.
What's Free
Workers AI meters compute in "neurons." On the free Workers plan:
- 10,000 neurons/day — no credit card required
- All 82 models at the standard tier — pick one per request
A ~500-token Llama 3 response costs roughly 400–600 neurons, so expect around 15–25 text calls/day free — enough for prototyping, side projects, and demos. Need more? The paid Workers plan is $5/month with $5 of compute credits included ($0.011 per 1,000 neurons beyond that).
What You Can Run
| Category | Models | Use Case |
|---|---|---|
| Text Generation | Llama 3.1 (8B, 70B), Llama 3.2, Mistral 7B, Phi-2, Qwen 1.5 | Chatbots, summarization, code |
| Embeddings | BAAI bge-small / bge-base-en-v1.5 | Semantic search, RAG |
| Image Generation | Stable Diffusion XL, dreamshaper-8-lcm | Image creation, thumbnails |
| Speech to Text | Whisper (tiny, base, large-v3-turbo) | Transcription, voice |
| Translation | M2M-100, Meta NLLB-200 | 200 languages |
| Vision / Classification | ResNet-50, MobileNetV2, DETR, distilbert-sst-2 | Labeling, detection, sentiment |
Note: the 70B Llama 3.1 is a paid-tier "GA" model with higher neuron costs. The 8B models run free without issues.
Get Started (Under 5 Minutes)
Create a free account at cloudflare.com, then generate a token under My Profile → API Tokens with the Workers AI: Run permission. Copy your Account ID from the dashboard sidebar and set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. No waitlist, no approval.
REST API (any language)
curl https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/run/@cf/meta/llama-3.1-8b-instruct
-H "Authorization: Bearer {API_TOKEN}"
-d '{
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain edge computing in one paragraph."}
]
}'
The response is {"result": {"response": "..."}, "success": true}.
Python Client
pip install cloudflare
import os
from cloudflare import Cloudflare
client = Cloudflare(api_token=os.environ["CLOUDFLARE_API_TOKEN"])
response = client.workers.ai.run(
account_id=os.environ["CLOUDFLARE_ACCOUNT_ID"],
model_name="@cf/meta/llama-3.1-8b-instruct",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is Cloudflare Workers AI?"}
]
)
print(response.response)
Cloudflare Worker (native edge deployment)
The native path runs inference inside a Worker deployed globally:
export default {
async fetch(request, env) {
const response = await env.AI.run('@cf/meta/llama-3.1-8b-instruct', {
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Summarize the concept of edge AI.' }
]
});
return new Response(JSON.stringify(response));
}
};
npm install -g wrangler
wrangler login
wrangler init my-ai-worker
# add to wrangler.toml: [[ai]] binding = "AI"
wrangler deploy
Beyond Text: Images, Speech, Embeddings
The same .run() call swaps model and payload for other modalities. Image generation with SDXL returns binary PNG data:
image_response = client.workers.ai.run(
account_id=os.environ["CLOUDFLARE_ACCOUNT_ID"],
model_name="@cf/stabilityai/stable-diffusion-xl-base-1.0",
prompt="A futuristic city skyline at sunset, digital art",
num_steps=20
)
with open("output.png", "wb") as f:
f.write(image_response)
Whisper transcription takes audio bytes and returns result.text:
with open("audio.mp3", "rb") as f:
audio_bytes = f.read()
result = client.workers.ai.run(
account_id=os.environ["CLOUDFLARE_ACCOUNT_ID"],
model_name="@cf/openai/whisper-large-v3-turbo",
audio=list(audio_bytes)
)
print(result.text)
Embeddings with @cf/baai/bge-base-en-v1.5 return vectors in result.data — the foundation for a free RAG or semantic-search pipeline.
Workers AI vs Other Free AI APIs
| Feature | Workers AI | Groq | Gemini | OpenRouter (free) |
|---|---|---|---|---|
| Free text | 10k neurons/day | 1,000 req/day (chat models) | Not published | 20 req/min (varies) |
| Image generation | Yes (SDXL) | No | Flash only | Some models |
| Speech transcription | Yes (Whisper) | Yes (Whisper) | No (free) | No |
| Embeddings | Yes (BGE) | No | Yes | Some |
| Edge deployment | Yes (300+ locs) | No | No | No |
| Credit card | No | No | No | No |
The standout advantage is multi-modal free inference: text, images, speech, embeddings, translation, and vision in one API within the daily neuron limit. Groq is faster for text but does no image generation; Gemini is more capable but its free tier is text-only.
Limits to Know
- One budget across every modality. Text, image, speech and embedding calls all draw from the same 10,000 neurons, and it resets daily with no rollover — an embedding batch competes with your chat traffic.
- 10,000 neurons/day is modest. A production chatbot with 100+ users will hit the cap — cache common queries with Cloudflare KV.
- Model tiers change. Cloudflare moves models from beta to GA, which shifts neuron pricing. Check the models page first.
- Small context. Llama 3.1 8B here has a 4,096-token window — smaller than the full model elsewhere.
- SDXL is slow. 10–30 seconds per image; fine for async, not real-time.
- No fine-tuning. You're limited to Cloudflare's hosted catalog — no custom weights.
Frequently Asked Questions
Do I need a credit card for the free tier?
No. The 10,000 neurons/day free tier starts immediately on a free Cloudflare account with no card, no waitlist, and no approval.
How many free requests is 10,000 neurons per day?
Roughly 15–25 text-generation calls, since a ~500-token Llama 3 response costs about 400–600 neurons. Image generation and larger models consume more, so real throughput depends on which models you call.
Can I run image generation and speech transcription for free?
Yes. Stable Diffusion XL and Whisper both run on the free tier within the neuron budget — a key edge over Groq (no images) and Gemini (text-only free tier).
When should I pick something else?
Use Groq for the fastest text generation, Gemini for the most capable free model, or OpenRouter's free models if you need more than 10,000 neurons/day without paying.
The Verdict
Workers AI is the most versatile free AI API in 2026 by modality coverage. The daily cap is modest for production, but for side projects, RAG prototypes, image tools, and transcription apps — especially with no credit card — it's genuinely useful. And no other free API runs your inference in 300+ locations, which matters for latency-sensitive, globally distributed apps. If you're already on Cloudflare, it's the easiest way to add AI without leaving the stack. Get started free at developers.cloudflare.com/workers-ai.