---
title: Cloudflare Workers AI
url: https://arcana.otnelhq.com/docs/providers/cloudflare-workers-ai
---

# Cloudflare Workers AI



Cloudflare Workers AI runs inference at the edge — no cold starts, no GPU provisioning. Use it for fast, serverless inference with models hosted on Cloudflare's global network.




## Setup



```bash
# 1. Get your API token from the Cloudflare dashboard
#    https://dash.cloudflare.com/profile/api-tokens
#    Create a token with "Workers AI" permissions

# 2. You also need your Cloudflare Account ID
#    Found at https://dash.cloudflare.com/ → right sidebar

export CLOUDFLARE_API_TOKEN=...
export CLOUDFLARE_ACCOUNT_ID=...

# 3. Verify detection
arcana doctor

# 4. Run
arcana run "hello"
```




## Available Models



| Model | Parameters | Best For |
| --- | --- | --- |
| `@cf/meta/llama-3.3-70b-instruct` | 70B | Best quality, complex tasks |
| `@cf/meta/llama-3.1-8b-instruct` | 8B | Fast, general purpose |
| `@cf/meta/llama-3.1-8b-instruct-awq` | 8B | Quantized, faster inference |
| `@cf/mistralai/mistral-7b-instruct-v0.2` | 7B | Instruction following |
| `@cf/qwen/qwen1.5-14b-chat-awq` | 14B | Multilingual, coding |
| `@cf/deepseek-ai/deepseek-math-7b-instruct` | 7B | Math reasoning |




## Config File



```json
{
  "provider": "cloudflare",
  "model": "@cf/meta/llama-3.3-70b-instruct"
}
```




## Environment Variables



| Variable | Description |
| --- | --- |
| `CLOUDFLARE_API_TOKEN` | Your Cloudflare API token (required) |
| `CLOUDFLARE_ACCOUNT_ID` | Your Cloudflare Account ID (required) |




## Finding Your Account ID



1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com)
2. Select any domain or go to the home page
3. Your Account ID is in the right sidebar under "API"
4. Alternatively, run `wrangler whoami` if you have the Wrangler CLI installed




## Creating an API Token



1. Go to [API Tokens](https://dash.cloudflare.com/profile/api-tokens)
2. Click "Create Token"
3. Use the "Workers AI" template or create a custom token with: @@B5@@
4. Copy the token and set it as an env var




## Pricing Notes



Workers AI uses a [neuron-based pricing model](https://developers.cloudflare.com/workers-ai/platform/pricing/). Approximate costs per 1M neurons:



| Model | Input (per 1M neurons) | Output (per 1M neurons) |
| --- | --- | --- |
| Llama 3.3 70B | $0.586 | $2.93 |
| Llama 3.1 8B | $0.046 | $0.23 |
| Mistral 7B | $0.028 | $0.14 |



The free tier includes 10,000 neurons/day for all Workers AI models.




## Tips



- Use `wrangler models list` to see all available models on your account
- Workers AI models run on Cloudflare's edge — latency is consistently low globally
- The free tier is generous for development and light usage
- For production workloads, the pay-as-you-go pricing is very competitive
- Works well for rapid prototyping since there's no GPU to provision




## Limitations



- Model selection is limited to Cloudflare's hosted catalog
- No custom fine-tuned models (unlike Bedrock or Together)
- Rate limits apply per-account (default: 300 requests/min)
- Max input length varies by model (typically 4K–32K tokens)
