OpenAI: Migrating to HTTPX2

(github.com)

83 points | by tosh 2 hours ago

11 comments

  • simonw 1 hour 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 22 minutes 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 16 minutes 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 14 minutes 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 39 minutes ago
      The issue with httpx is that it has an obnoxious and toxic maintainer.
      • portly 36 minutes ago
        What happened?
        • beanjuiceII 26 minutes ago
          was probably chewing bubble gum on the wrong sidewalk
          • jatora 21 minutes ago
            this made me laugh even though i dont think i even get it. can you explain this please lol
            • beanjuiceII 3 minutes ago
              people think other people are 'toxic' for the silliest of things most times; and this person is saying some maintainer is toxic to put it out there but provides no information as to why.. so i figured my context is as good as theirs
    • networked 1 hour 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 17 minutes 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

      • 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 24 minutes ago
      A bit strange considering "coding is solved".

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

      • simonw 14 minutes ago
        A migration document like this one is how you get that ~free upgrade - it's something you can point an agent at.
    • tonyhart7 30 minutes 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 21 minutes ago
        Open Source disputes.
    • rolymath 1 hour 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).

      • chme 1 hour ago
        That isn't confusing at all, if you know how maintained stable releases work.

        Happens with the Linux kernel as well.

      • hk__2 26 minutes 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 1 hour 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 40 minutes ago
        Tangibly related, did you know that odd versions of node don't get LTS, I found it odd at first
      • paulddraper 15 minutes 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.

    • SimonWAds 43 minutes ago
      [flagged]
  • ZeroCool2u 12 minutes 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.
  • mrtksn 10 minutes ago
    Well, the client side of the AI chat sucks for me lately. Both ChatGPT and Gemini will say that the connection was lost or there’s a problem with the page and will force me to reload and send the promt again. Especially Gemini is horrible, this starts happening just after the second message. I dread using through the browser both. I haven’t investigated why this happens but maybe this change will come with an improvement.
  • londons_explore 1 hour ago
    There seems to be a bunch of downsides mentioned...

    But what are the upsides of this change?

  • fsuts 20 minutes ago
    Why is everyone so slow to move to http3?
  • tosh 2 hours ago
    nb: operating system TLS trust store is used now (instead of certifi)
  • ledoncool 1 hour ago
    Wow, finally...
  • hno5b8kgpg 5 minutes ago
    [dead]
  • preetham_rangu 1 hour ago
    [flagged]
  • CurbStomper 34 minutes ago
    [dead]