Skip to main content

Cloudflare Workers AI

Run AI models on Cloudflare's global edge network.

Configuration

FieldRequiredExample
Application NameYesmy-cloudflare-app
Model NameYes@cf/meta/llama-3-8b-instruct
Account IDYesYour Cloudflare Account ID
API TokenYesYour Cloudflare API Token

Getting Your Credentials

Account ID:

  1. Log in to Cloudflare Dashboard
  2. Select your account
  3. Find Account ID in the right sidebar

API Token:

  1. Go to My ProfileAPI Tokens
  2. Click Create Token
  3. Use the Workers AI template or create custom
  4. Copy and securely store the token

Model Naming Format

Cloudflare models use the format @cf/provider/model-name:

ModelDescription
@cf/openai/gpt-oss-120bOpenAI open model with Code Interpreter
@cf/openai/gpt-oss-20bOpenAI smaller open model
@cf/meta/llama-4-scout-17b-16e-instructLlama 4 Scout multimodal
@cf/meta/llama-3.3-70b-instruct-fp8-fastLlama 3.3 70B optimized
@cf/qwen/qwq-32bQwen reasoning model
@cf/google/gemma-3Multimodal, 128K context, 140+ languages
@cf/black-forest-labs/flux-2-devFLUX.2 image generation

Note: Cloudflare partnered with OpenAI as a Day 0 partner for their open models with Code Interpreter support.

For the complete list of available models, visit the Cloudflare Workers AI Models.

Advanced Parameters

ParameterTypeDescription
max_tokensintegerMaximum tokens
temperaturefloatRandomness
top_pfloatNucleus sampling
seedintegerFor reproducibility

Setup Steps

  1. Navigate to AI Applications → New Application
  2. Select Model Providers tab
  3. Click Cloudflare Workers AI
  4. Enter your Application Name
  5. Enter your Account ID
  6. Enter your API Token
  7. Select your desired Model Name
  8. Configure Advanced Settings (optional)
  9. Click Test Response to verify (optional)
  10. Review and submit