Skip to content
Back to feed

November 11, 2026 · Cloudflare

Cloudflare CLI, Workers - Send custom API headers with Wrangler and Cloudflare CLI

Wrangler 4.160.0 and Cloudflare CLI (cf) 1.0.0-beta.29 support custom headers for Cloudflare API requests. Use CLOUDFLARE_API_HEADERS to add headers or override most generated values, with the exception of protected body and transport headers.

For example, to send X-Custom-Header: value, set:

export CLOUDFLARE_API_HEADERS='{"X-Custom-Header":"value"}'

Then run your Wrangler or cf command.

For usage and restrictions, refer to the Wrangler environment variable reference and Cloudflare CLI environment variable reference.

All Cloudflare CLI changes