← Back
Cloudflare
Cloudflare Python SDK v5.0.0-beta.1 introduces major breaking changes and 40+ new API resources
Cloudflare WorkersCloudflare · sdkreleasebreaking-changeapifeature · developers.cloudflare.com ↗

Breaking Changes and Migration Required

Cloudflare Python SDK v5.0.0-beta.1 introduces extensive breaking changes affecting 15 resource modules. These changes stem primarily from improvements to the underlying OpenAPI definitions and codegen updates. Affected resources include 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, and zerotrust.networks.

Action required: Developers using the Python SDK must review the v5 Migration Guide before upgrading, as downstream code may require updates.

40+ New API Resources

The beta release adds comprehensive coverage for new Cloudflare services:

  • AI Features: ai.tomarkdown (markdown conversion), aigateway.dynamicrouting, aigateway.providerconfigs, aisearch, aisearch.instances, aisearch.tokens, radar.ai
  • Security & Compliance: abusereports, brandprotection.* (logos, matches, queries), fraud, tokenvalidation.*
  • Data & Infrastructure: d1.database, pipelines.* (sinks, streams), r2datacatalog.*, connectivity.directory
  • Real-time Services: realtimekit.* (active sessions, analytics, apps, meetings, recordings, webhooks)
  • Organization & IAM: organizations, organizations.organizationprofile, iam.sso
  • Networking: loadbalancers.monitorgroups, origintlsclientauth.*

Enhanced Request/Response Handling and Type System

The release includes significant improvements to the SDK's foundation:

  • Type System: Enhanced type inference for Pyright, improved TypedDict support, added missing method argument and response types, and Pydantic pre-2.8.0 compatibility
  • Request Handling: Proper multipart/form-data support with JSON data, correct header handling to avoid sending unnecessary defaults, and Content-Type header fixes for GET requests
  • Response Parsing: Better accuracy for discriminated unions, extra field types, metadata handling, and resource name singularization rules

Current Status and Next Steps

This is a beta release, so additional breaking changes may occur before the v5.0.0 final release. Developers should test the beta version in non-production environments and report any issues or discrepancies via the Cloudflare SDK repository. The full changelog comparing v4.3.1 to v5.0.0-beta.1 is available on GitHub.