OpenAI: Migrating to HTTPX2

(github.com)

106 points | by tosh 3 hours ago

14 comments

  • simonw 2 hours ago
    Anthropic made the same change a few weeks after OpenAI did: https://github.com/anthropics/anthropic-sdk-python/releases/...

    The problem with httpx as a dependency is that it's currently working towards a 1.0 release which will be full of breaking changes.

    The httpx2 project is essentially a fork that promises not to break the existing API, which makes it a more stable dependency to build against.

    I wrote a pretty long comment about my concerns for the breaking 1.0 version last year - https://github.com/encode/httpx/discussions/3344#discussionc... - in that comment I recommended the HTTPX project release their 1.0 as a package called httpx2 instead, but a year later we now have an httpx2 (released by a different maintainer) that keeps the old API.

    • Aurornis 1 hour ago
      > The problem with httpx as a dependency is that it's currently working towards a 1.0 release which will be full of breaking changes.

      The httpx maintainer closed off access to issues and discussions on the repo, has been ignoring PRs, and hasn’t updated it in a half a year.

      I don’t think there is any reason to consider httpx as a viable project any more. The Pydantic httpx fork has taken its place.

      • simonw 1 hour ago
        HTTPX stable hasn't had a release since December 2024, but there have been two dev releases of the 1.0 branch this month (after a gap since September 2025.)

        Unfortunately that 1.0 work is happening in a private repository.

        https://pypi.org/project/httpx/#history

        • Aurornis 1 hour ago
          > Unfortunately that 1.0 work is happening in a private repository.

          That’s even more reason to consider it non-viable.

          There is no reason to encourage or support this type of behavior in a project. It is their right to do with it as they please, but I’m not interested in a project that functions like this. The forks are continuing to operate like true community projects.

    • superze 1 hour ago
      The issue with httpx is that it has an obnoxious and toxic maintainer.
    • networked 2 hours ago
      So I guess HTTPX2 (https://github.com/pydantic/httpx2) is winning out over HTTPXYZ (https://codeberg.org/httpxyz/httpxyz)? I didn't switch to HTTPXYZ after the fork but have been watching it. (What I did was use urllib.request more and bite the Rust bullet with wreq, https://github.com/0x676e67/wreq-python, where it wasn't enough.)
      • kelvinjps10 1 hour ago
        in their README >Important

        We started this fork because there was no activity on HTTPX, a very popular Python HTTP library.

        A few weeks later, Pydantic started their own fork called HTTPX2. We decided to embrace this and support HTTPX2. We're upstreaming our fixes to HTTPX2 and in our opinion it should be the "blessed" fork. Pydantic can make this more successful than we ever can.

        See also https://tildeweb.nl/~michiel/httpx2.html

        Thanks for all your support!

        Sander & Michiel

        • NewJazz 20 minutes ago
          It is too bad because httpxyz is absolutely the better name.
      • simonw 1 hour ago
        httpx2 is sponsored by Pydantic and has involvement from the new maintainer of Starlette, so it's off to a very strong start.
    • krzyk 1 hour ago
      A bit strange considering "coding is solved".

      But seriously, migrating between different libs should be ~free for both Anthropic and OpenAI.

      • simonw 1 hour ago
        A migration document like this one is how you get that ~free upgrade - it's something you can point an agent at.
    • tonyhart7 1 hour ago
      "I recommended the HTTPX project release their 1.0 as a package called httpx2 instead, but a year later we now have an httpx2 (released by a different maintainer) that keeps the old API"

      wtf is going on

      • ClikeX 1 hour ago
        Open Source disputes.
    • SimonWAds 1 hour ago
      [flagged]
    • rolymath 2 hours ago
      The Python community loves confusing versioning.

      I mean, obviously Python 2.7 is newer than Python 3.1

      I remember swearing I would never migrate to python3 but here we are, I migrated without even feeling it or realizing when (But I do remember django played a big role).

      • jubilanti 20 minutes ago
      • chme 2 hours ago
        That isn't confusing at all, if you know how maintained stable releases work.

        Happens with the Linux kernel as well.

      • hk__2 1 hour ago
        There are a lot of large projects where X.1 is newer than Y.0. You release a new major version for breaking changes, but you backport security changes to previous major releases as well.
      • Longwelwind 2 hours ago
        Isn't that whole point of semantic release?

        Minors and hotfixes allow you to release a new version for an older release (like if you released 3.7 but you found a bug present in 3.4, you can release 3.4.1 which would be newer than 3.7), making it possible to have multiple supported versions at the same time.

      • yard2010 1 hour ago
        Tangibly related, did you know that odd versions of node don't get LTS, I found it odd at first
      • paulddraper 1 hour ago
        That’s probably the worst example you could have chosen.

        You shouldn’t assume anything about relative date of 2.7 and 3.1.

  • jklehm 25 minutes ago
    Wonder if they evaluated httpx2 vs niquests: https://github.com/jawah/niquests
  • ZeroCool2u 1 hour ago
    The requests packages fundamental API is good enough and is now maintained by the PSF. I don't understand why OpenAI and Anthropic don't just throw some $$$ to the PSF for focused improvements and expansion of it.
    • awildfivreld 14 minutes ago
      The maintainers of requests have made it pretty clear that they consider that package feature complete, and have not showed interest in adding native async support to the core.
  • KaiserPro 12 minutes ago
    Why would you want to use HTTPX2 over say requests?
  • ironqcold 31 minutes ago
    Oh, well... It was bound to happen eventually. I suppose there must be some advantages to such a solution.
  • londons_explore 2 hours ago
    There seems to be a bunch of downsides mentioned...

    But what are the upsides of this change?

  • tosh 3 hours ago
    nb: operating system TLS trust store is used now (instead of certifi)
  • ledoncool 2 hours ago
    Wow, finally...
  • fsuts 1 hour ago
    Why is everyone so slow to move to http3?
    • KaiserPro 14 minutes ago
      because its over QUIC, which is different enough to be a pain.

      Not that there is anything wrong with QUIC, at least its built by someone who knows what they are doing, unlike HTTP2

  • preetham_rangu 1 hour ago
    [flagged]
  • hno5b8kgpg 57 minutes ago
    [dead]
  • CurbStomper 1 hour ago
    [dead]