The Cloudflare AI Stack: Workers AI, Vectorize, AI Gateway and AI Search

Quick answer: Workers AI runs open-weight models serverlessly and bills in Neurons. Vectorize is a vector database billed on vector dimensions and capped at 1,536 dimensions. AI Gateway is an observability and caching layer whose core features are free. AI Search (formerly AutoRAG) is a managed RAG pipeline, free during open beta. In any real RAG system, generation dominates the bill, not the vector database. And if the task needs frontier-model reasoning, Cloudflare cannot match OpenAI or Anthropic (pricing as of July 2026).

Most teams starting on AI ask the wrong question first. The question is not which model to use. The question is which jobs are cheap enough to run on a small model, and which jobs are expensive enough that you must reach for a large one. In a production AI system the cost concentrates almost entirely in one place: generation.

Cloudflare has four pieces here: Workers AI (inference), Vectorize (embeddings), AI Gateway (control and observability), and AI Search (managed RAG). This article covers what each one is, what it actually costs at realistic volume, and, most importantly, when you should walk away and call OpenAI or Anthropic instead. Every number below comes from a Cloudflare pricing or limits page as of 13 July 2026.

Names that have changed. Read this first

Two renames will otherwise send you to the wrong documentation.

AutoRAG is now AI Search. Instances created after 16 April 2026 come with built-in storage, a built-in vector index and web crawling. Older instances were migrated to managed infrastructure on 3 June 2026.

Browser Rendering is now Browser Run, and it is now built into AI Search, so you are no longer billed separately for Browser Run usage when AI Search crawls a website.

Workers AI: billed in Neurons

Workers AI runs open-weight models on Cloudflare GPUs, serverlessly. The headline price is $0.011 per 1,000 Neurons, where a Neuron is Cloudflare unit of GPU compute. Every account gets 10,000 Neurons per day free, on both Free and Paid plans, resetting at 00:00 UTC.

In practice you rarely need to think in Neurons, because Cloudflare now publishes per-model prices in dollars per million tokens, directly comparable with other providers.

Model (selection) Input / M tokens Output / M tokens Good for
@cf/meta/llama-3.2-1b-instruct $0.027 $0.201 Simple classification at huge volume
@cf/meta/llama-3.1-8b-instruct-fp8-fast $0.045 $0.384 The RAG workhorse; best value
@cf/meta/llama-3.3-70b-instruct-fp8-fast $0.293 $2.253 When answer quality really matters
@cf/openai/gpt-oss-20b $0.200 $0.300 Cheap output on long answers
@cf/openai/gpt-oss-120b $0.350 $0.750 Far cheaper output than the 70B
@cf/aisingapore/gemma-sea-lion-v4-27b-it $0.351 $0.555 Built for Southeast Asian languages
@cf/qwen/qwen3-30b-a3b-fp8 $0.051 $0.335 Very cheap for its size
@cf/deepseek-ai/deepseek-r1-distill-qwen-32b $0.497 $4.881 Reasoning, but output is expensive
@cf/baai/bge-m3 (embedding) $0.012 Cheapest embedding model
@cf/openai/whisper $0.0005 per audio minute Speech to text

Thai teams should note one model in particular. Cloudflare carries gemma-sea-lion-v4-27b-it from AI Singapore, a model built specifically for Southeast Asian languages. If your workload is predominantly Thai, that is the model to benchmark against Llama before you commit to anything.

Limits you should design around

The default rate limit for Text Generation is 300 requests per minute. Text Embeddings is 3,000 requests per minute, and Automatic Speech Recognition is 720 requests per minute. If you are building a high-traffic chatbot, 300 req/min is the number to raise with Cloudflare early, not late.

Use Workers AI when / do not use Workers AI when

Use it when: the job is high-volume and a small model already does it well. Classification, summarisation, embeddings, transcription, spam detection and sentiment all run fine on an 8B model and cost a fraction of a frontier model. The bonus is that inference happens close to the user, so there is no cross-continent round trip.

Do not use it when: the job needs deep reasoning, agentic coding, or a very long context. The open-weight models Cloudflare offers cannot match the frontier models from OpenAI or Anthropic. That is a fact, not an opinion, and pretending otherwise will cost you in production.

Vectorize: billed on vector dimensions

Vectorize does not bill for CPU, memory, active index hours, or how many indexes you create. It bills on two things only: queried vector dimensions and stored vector dimensions.

The formula people get wrong is the queried one. It is not the number of vectors you searched for. It is (queried vectors + stored vectors) x dimensions. In other words, the bigger the index, the more each individual query costs.

Service Workers Free Workers Paid Key limit
Vectorize – queried dimensions 30M/month First 50M free, then $0.01/million topK max 50 with metadata
Vectorize – stored dimensions 5M First 10M free, then $0.05/100 million Max 1,536 dimensions (float32)
Vectorize – vectors per index 10,000,000 Metadata 10 KiB per vector
AI Gateway – core features Free on all plans (analytics, caching, rate limiting) DLP scanning also free
AI Gateway – persistent logs 100,000 logs total 10,000,000 logs per gateway Logpush $0.05/million
AI Gateway – Unified Billing 5% fee on credits purchased Provider rates passed through
AI Search – price Free during open beta (Workers AI + AI Gateway billed separately) Max file size 4 MB
AI Search – queries 20,000/month Unlimited Max 5 custom metadata fields
AI Search – files per instance 100,000 1M (500K for hybrid search) 500 pages crawled/day on Free

Use Vectorize when / do not use Vectorize when

Use it when: you are doing semantic search or RAG and you are already on Cloudflare, and your embeddings are 1,536 dimensions or fewer. Because it charges nothing for idle time and nothing for egress, it is very cheap for an index that is not queried constantly.

Do not use it when: your embeddings are larger than 1,536 dimensions. A 3,072-dimension embedding simply will not fit, and you will need pgvector, Pinecone or Qdrant. Also note topK caps at 50 when you request values or metadata, which constrains pipelines that retrieve wide and then rerank.

AI Gateway: the piece people overlook

AI Gateway sits between your app and the model, whether that model is on Workers AI, OpenAI, Anthropic or anywhere else. You change one base URL and you get analytics, caching and rate limiting.

The core features are free on all plans. That is genuinely unusual and it is the best offer in the stack. Caching alone can cut your inference bill meaningfully for repeated questions.

Three things do cost money. Persistent logs beyond your quota (Free gives 100,000 logs total across all gateways; Paid gives 10 million per gateway). Guardrails, which run llama-guard-3-8b on Workers AI and are therefore billed as normal token inference. And Unified Billing, which adds a 5% fee on credits purchased: buy $100 of credit and you are charged $105, though provider inference rates are passed through with no markup.

Use AI Gateway when / do not use AI Gateway when

Use it when: basically always. It is free, it gives you observability you need anyway, and it lets you swap models without rewriting code. It is also what makes the sensible hybrid architecture possible: Workers AI for cheap high-volume work, frontier models for the hard work, both behind one gateway.

Do not use it when: you already run dedicated LLM observability such as Langfuse or Helicone and the team is happy with it. Adding another layer buys you nothing.

AI Search: managed RAG

AI Search is what used to be AutoRAG. It handles chunking, embedding, continuous re-indexing and retrieval for you. You point it at your data and query it in natural language through a Worker binding, a REST API, or the MCP server that every instance ships with.

Right now AI Search is free during open beta within its limits, though Workers AI and AI Gateway are billed separately. Read that carefully: free applies to the orchestration, not to the inference underneath, which is where the money actually is. Cloudflare says it will give at least 30 days of notice before billing starts.

Use AI Search when / do not use AI Search when

Use it when: you want RAG quickly for a knowledge base, a documentation search, or as a tool for an AI agent, and you do not want to own chunking logic and an indexing pipeline. The built-in MCP endpoint is a genuine advantage if you are building agents.

Do not use it when: you need fine control over chunking or reranking; your files are larger than 4 MB; you need more than 5 custom metadata fields or metadata values longer than 500 characters. And most importantly, think hard before putting a revenue-critical product on a beta with unannounced pricing.

Worked example: a RAG chatbot over an internal knowledge base

Take a Thai business with 50,000 internal documents, chunked into 200,000 chunks, using 768-dimension embeddings, answering 100,000 queries a month. Each query pulls roughly 2,000 tokens of context and returns about 300 tokens.

Line item Calculation With Llama 3.1 8B With Llama 3.3 70B
Workers Paid Base subscription $5.00 $5.00
Vectorize – stored 200,000 x 768 = 153.6M; minus 10M free = 143.6M x $0.05/100M $0.07 $0.07
Vectorize – queried (100,000 + 200,000) x 768 = 230.4M; minus 50M free = 180.4M x $0.01/M $1.80 $1.80
Embedding – indexing (bge-m3) 200,000 chunks x 500 tokens = 100M tokens x $0.012/M $1.20 $1.20
Embedding – queries 100,000 x 20 tokens = 2M tokens $0.02 $0.02
Generation – input 100,000 x 2,000 = 200M tokens $9.00 $58.60
Generation – output 100,000 x 300 = 30M tokens $11.52 $67.59
AI Gateway Core features free $0.00 $0.00
Total ~$28.61 ~$134.28

Read that table carefully, because it contains the single most important point in this article. The vector database costs under two dollars. Generation is about 94% of the bill on the 70B model. Teams routinely spend weeks choosing a vector database. That line is a rounding error.

Switching from the 70B to the 8B cuts the bill by 79%. So the question worth agonising over is not which vector DB is fastest, it is how big a model this job actually needs. The way to answer it is to build an eval from real user questions and use the smallest model that passes.

Turn on AI Gateway caching and, if 30% of questions repeat, generation drops by roughly the same proportion at no extra cost, because caching is one of the free core features.

Decision matrix: if you need X, use Y

If you need Use Why
Classification, summarisation or moderation at volume Workers AI (8B) $0.045/$0.384 per M tokens, far below frontier pricing
Strong Thai-language performance gemma-sea-lion-v4-27b-it Purpose-built for Southeast Asian languages
Deep reasoning, agentic coding, very long context OpenAI / Anthropic (via AI Gateway) Cloudflare has no frontier-class model
Semantic search with embeddings up to 1,536 dims Vectorize No idle or egress charges; billed on dimensions used
Embeddings larger than 1,536 dims (e.g. 3,072) pgvector / Pinecone / Qdrant Vectorize hard-caps at 1,536 dimensions
Observability and caching across every LLM provider AI Gateway Core features are free; one base URL change
RAG without owning the pipeline AI Search Chunking, embedding and indexing automatic; MCP built in
Fine control over chunking or reranking Vectorize + your own code AI Search does not expose that level of control
Files larger than 4 MB Split before indexing AI Search caps file size at 4 MB

When OpenAI or Anthropic wins

Be blunt about this. The models on Workers AI are open-weight models from small to mid-size. They are excellent value for well-scoped work. They are not in the same league as the best frontier models.

Work that genuinely needs reasoning

Analysing a contract across many pages of legal language. Writing agentic code that must plan several steps ahead. Reconciling financial records where accuracy has to be very high. An 8B model will not do these well, and even a 70B will not match a frontier model from OpenAI or Anthropic. Forcing a small model into this work to save money usually backfires: the output is unusable, which is far more expensive.

The architecture we actually recommend

Stop treating this as a binary. Use Workers AI for the high-volume work small models do well (classification, summarisation, embeddings, moderation) and route the hard work to a frontier model through the same AI Gateway. You get analytics, caching and rate limiting across both, and you pay frontier prices only where they earn their keep. We compared the two sides directly in Workers AI vs OpenAI.

The Vectorize dimension ceiling

Vectorize supports at most 1,536 dimensions. If the embedding model you want produces 3,072 dimensions, it will not fit, and reducing the dimensionality may hurt retrieval quality. In that case use pgvector on a Postgres you already run, or Pinecone or Qdrant. We covered Postgres on Cloudflare in D1 vs PostgreSQL.

Beta risk

AI Search is free today, but post-beta pricing has not been announced. If you are building a product whose economics depend heavily on RAG, resting your margin on an unannounced price is a risk, not a strategy. Start with internal workloads and expand once pricing is clear.

For the wider compute picture, see Cloudflare compute services explained.

Summary for the person who has to decide

Three questions. Does the task genuinely need frontier reasoning, or do you merely assume it does? If you only assume, run an eval against an 8B model first. Are your embeddings 1,536 dimensions or fewer? If not, Vectorize is out. And remember that generation is by far the largest line on the bill, so spend your optimisation effort on the model, not on the vector database.

Cipher designs and implements systems on the Cloudflare Developer Platform for businesses in Thailand. If you are architecting a RAG system or an agent and want to know which work belongs on Workers AI and which should be routed to a frontier model, we can assess the architecture and cost it out against your real volume.

Frequently Asked Questions

How does Workers AI bill

In Neurons, at $0.011 per 1,000 Neurons, with 10,000 Neurons per day free on both Free and Paid plans. Cloudflare also publishes per-model prices in dollars per million tokens, so you can compare directly with other providers. For example, llama-3.1-8b-instruct-fp8-fast is $0.045 per million input tokens and $0.384 per million output tokens.

How many dimensions can Vectorize store

A maximum of 1,536 dimensions per vector at 32-bit (float32) precision, and up to 10,000,000 vectors per index. If your embedding model produces 3,072 dimensions it will not fit in Vectorize, so you must reduce the dimensionality or use pgvector, Pinecone or Qdrant instead.

Does AI Search (formerly AutoRAG) cost anything

AI Search is currently free during open beta within its published limits, but Workers AI and AI Gateway are billed separately. The Free plan allows 20,000 queries per month while Paid is unlimited, and the maximum file size is 4 MB (information as of July 2026).

Is AI Gateway really free

The core features are genuinely free on all plans: dashboard analytics, caching and rate limiting, and DLP scanning is free too. What does cost money is persistent logs beyond your quota, Guardrails (billed as Workers AI token inference), and Unified Billing, which adds a 5% fee on credits purchased.

When should I use OpenAI or Anthropic instead of Workers AI

When the task needs deep reasoning, such as multi-page legal analysis, agentic coding, or work with a very long context. Cloudflare open-weight models cannot match frontier models on these. The best architecture is to use Workers AI for high-volume work that small models handle well, and route the hard work to a frontier model through the same AI Gateway.

Scroll to Top