Grok on Cloudflare & Vercel: Free on Vercel, Paid-but-Keyless on Cloudflare

Grok available on Cloudflare and Vercel

1. What happened

In June 2026, Cloudflare and Vercel both made xAI's full Grok lineup (text / image / video / code) available on their platforms. But the two routes differ sharply on cost:

  • Vercel is the genuinely free route: even the free Hobby plan gets $5 of system credits every month, keyless via the AI SDK.
  • Cloudflare is paid but convenient: Grok runs through AI Gateway Unified Billing — you prepay credits to Cloudflare and it bills you for Grok at xAI's rates (passed through, no markup), with no separate xAI key. There is no free allowance for these third-party models — Cloudflare's free Neurons tier is only for its own @cf/ models.

So: want Grok for free? Go Vercel. Want one bill, no provider keys, and spend controls? Cloudflare's unified billing is the convenient paid route.

2. Two routes — free vs. convenient

Vercel AI Gateway — free

  • $5/month system credit (including the free Hobby plan), keyless (no BYOK).
  • One line via the AI SDK: model: 'xai/grok-4.3'.
  • Text and image fit inside the free credit; video needs a paid plan.

Cloudflare AI Gateway — paid (Unified Billing)

  • Prepay credits in the Cloudflare dashboard (a 5% fee applies to top-ups); Grok is billed at xAI's pass-through rates, no markup.
  • No extra key: env.AI.run("xai/...") deducts from your Cloudflare balance.
  • Upside: a single bill, no separate provider accounts/keys, spend limits, global edge.
  • No free tier for xai/... models (the free Neurons are only for @cf/ models).

In short: free → Vercel; consolidated paid billing without keys → Cloudflare.

3. The Grok family at a glance

  • Grok 4.3 (text): 1M-token context, real-time access to X data, strong agentic tool calling, native image understanding.
  • Grok Imagine Image / Image Pro (image): text-to-image across photorealistic-to-illustrative styles; Pro pushes detail, lighting and composition further. Image is Grok's strong suit.
  • Grok Imagine (video): text-to-video / image-to-video / video editing, with motion and audio. (Paid on both — Vercel needs a paid plan, Cloudflare bills it via unified billing.)
  • Grok Build 0.1 (code): 256K context, always-on reasoning, purpose-built for agentic software engineering.

4. Quick start

Vercel (AI SDK, keyless)

javascript
import { streamText } from 'ai';
// OIDC on Vercel means no explicit key; locally use AI_GATEWAY_API_KEY
const { textStream } = streamText({
  model: 'xai/grok-4.3',
  prompt: 'Explain black holes in one sentence.',
});
for await (const chunk of textStream) process.stdout.write(chunk);

Switch to image generation with one line:

javascript
import { experimental_generateImage as generateImage } from 'ai';
const { image } = await generateImage({
  model: 'xai/grok-imagine-image',
  prompt: 'A neon cyberpunk fox, cinematic lighting, ultra-detailed',
});

Cloudflare (Workers AI binding, no extra key — billed via Unified Billing)

javascript
export default {
  async fetch(request, env) {
    // No extra key/env; usage is billed to your Cloudflare credit balance
    const res = await env.AI.run('xai/grok-4.3', {
      messages: [{ role: 'user', content: 'Explain black holes in one sentence.' }],
    });
    return Response.json(res);
  },
};

5. Cost, plainly

  • Vercel: $5/month of system credit, keyless; stay under it and text/image are free. Video needs a paid plan.
  • Cloudflare: not free for Grok — you prepay credits (5% top-up fee) and pay xAI's per-token rates with no markup. The upside is one consolidated bill and no separate API keys.

Pick Vercel to use Grok for free; pick Cloudflare when you want consolidated billing and keyless access and don't mind paying.

Cloudflare Workers AI

Free Grok 4.3 on Cloudflare

Paid (Cloudflare Unified Billing): Grok 4.3 keyless via Cloudflare — prepay credits, billed at xAI pass-through rates, no markup. For free, use Vercel.

Vercel AI Gateway

Free Grok 4.3 on Vercel

Call Grok 4.3 free on Vercel — keyless, covered by the $5/month AI Gateway credit.

Cloudflare Workers AI

Free Grok Imagine Video on Cloudflare

Paid (Cloudflare Unified Billing): Grok video keyless via Cloudflare — prepaid credits, xAI pass-through pricing. (Video is paid on Vercel too.)

xAI
Image Generation

Grok Imagine Image

xAI text-to-image, photorealistic to illustrative — image is Grok's strong suit. Free on Vercel ($5/mo); paid-but-keyless on Cloudflare.