shiichan

Cloudflare Python SDK v5.0.0: Did You Know Python 3.8 Support Just Ended?

Hey, it's me! I was scrolling through the Cloudflare Changelog today and spotted something developers should know about. If you touch Cloudflare's API from Python, this one's worth a look, so let's dive in.

Cloudflare Changelog developers.cloudflare.com

What was announced?

According to the Cloudflare Changelog, the official Cloudflare Python SDK just jumped to a new major version, v5.0.0 — and this is a full, stable release, not a beta. The post describes it as "a major release... It drops support for Python 3.8, adds 11 new API services, introduces optional aiohttp backend support for improved async concurrency, and includes hundreds of type and method updates across the entire API surface."

That's a lot to unpack, so let's go through it piece by piece.

The story so far

The previous SDK line (v4.x) supported Python 3.8 and up, and the async client only ran on the standard HTTP backend. The minimum required version of typing-extensions was also a looser >=4.10.

On the API side, newer Cloudflare capabilities like AI Search and Connectivity testing weren't part of the SDK yet, so you'd have needed another way to reach them.

What changes

Here's how the announced changes break down.

Supported Python versions got a refresh:

  • Python 3.8 support has ended; the new minimum is Python 3.9
  • Python 3.13 and 3.14 are now tested and supported

The dependency requirement moved up too:

  • The minimum typing-extensions version rose from >=4.10 to >=4.14

On the async side, the biggest addition is an optional aiohttp backend. The async client can now use aiohttp as its HTTP backend for improved concurrency performance. Here's how you opt in:

pip install cloudflare[aiohttp]

Then just pass DefaultAioHttpClient() as the http_client parameter. That should help a lot if you're firing off large numbers of async requests.

And the biggest chunk of this release is the 11 brand-new API services now available directly from the SDK as top-level resources:

  • AI Search — AI-powered search capabilities
  • Connectivity — connectivity testing and diagnostics
  • Email Sending — email send and send_raw endpoints
  • Fraud — fraud detection and prevention
  • Google Tag Gateway — Google Tag Gateway management
  • Organizations — organization audit logs and management
  • R2 Data Catalog — R2 Data Catalog operations
  • Realtime Kit — realtime communication (Calls / TURN)
  • Resource Tagging — resource tagging and labeling
  • Token Validation — token validation configuration and rules
  • Vulnerability Scanner — vulnerability scanning, credential sets, and target environments

Areas you previously had to reach some other way are now unified right inside the SDK.

Dive Deep

There's also a solid batch of breaking changes, so it's worth checking these before upgrading.

According to the post, the following 15 resources carry breaking changes:

  • abusereports
  • acm.totaltls
  • apigateway.configurations
  • cloudforceone.threatevents
  • d1.database
  • intel.indicatorfeeds
  • logpush.edge
  • origintlsclientauth.hostnames
  • queues.consumers
  • radar.bgp
  • rulesets.rules
  • schemavalidation.schemas
  • snippets
  • zerotrust.dlp
  • zerotrust.networks

Detailed migration steps are laid out in the Migration Guide, so if you're using any of the above, that's the place to check.

Beyond the breaking changes, plenty of existing services also got new endpoints, including:

  • api_gateway: Labels endpoints
  • billing: Billable usage PayGo endpoint
  • brand_protection: v2 endpoints
  • browser_rendering: DevTools methods
  • cache: Origin cloud regions resource
  • dns: dns_records/usage endpoints
  • iam: user groups and user group members resources
  • zero_trust: Access Users, DEX rules, WARP Connector connections and more
  • zones: zone environments endpoints

On top of that, there are smaller type-level bug fixes across Pipelines, DLP, and Radar — matching the "hundreds of type and method updates" the post promises.

Wrap-up

  • Cloudflare's Python SDK reached major version v5.0.0 — a stable release, not a beta
  • Python 3.8 support ended, with the new minimum at 3.9; Python 3.13/3.14 are now tested and supported
  • The minimum typing-extensions requirement rose from >=4.10 to >=4.14
  • An optional aiohttp backend, enabled via pip install cloudflare[aiohttp], boosts async concurrency
  • 11 new API services — including AI Search, Connectivity, and Realtime Kit — are now part of the SDK
  • 15 resources carry breaking changes, and many existing services also gained new endpoints

If you're a Python developer working with Cloudflare's API — especially around Workers, DNS, or Zero Trust — it's worth reviewing the change list above before upgrading.