openai-python v3.59.0
- Source
- github.com
- Author
- openai-sdks[bot]Top Viber
- Date

Context
Version 3.59.0 of OpenAI's Python library stops API errors from carrying the credentials of the request that failed (release notes). When a call fails, the library raises an exception such as `APIStatusError`, and that exception keeps a copy of the request it sent, reachable as `error.request` and through `error.response.request`. Before this release that copy included the request's headers as sent, among them the `` header holding the API key, so code that logged or stored an exception's request could write the key down with it.
Pull request 4316 gives the exception a copy with the sensitive headers removed. It reuses the list the library already applies when it redacts headers in its debug logs, which in the library's source is `authorization`, `api-key` and `x-amz-security-token`. The logs replace those values with `<redacted>`, while the error's copy drops the headers entirely. Requests in a response's redirect history get the same treatment, and the request the library actually sends is left alone, so live calls are unaffected.
The change can break one pattern: code that takes the request stored on an error and sends it again. That copy no longer has the header that authenticated it, and the pull request says such callers "must reapply ." The release's other fixes reject empty webhook signing keys and non-finite numbers in agent tool arguments, switch beta Realtime sessions to bearer authentication, and check the agent upload directory again after its is resolved. It also adds healthcare model IDs for the Responses API, which the notes do not describe further.
- Authorization — The check that an authenticated identity is permitted to perform a particular operation on a particular resource.
- Authentication — The check that a presented credential matches the identity it claims.
- Path — A description of a file or folder location, written using directory names and separators.
- Credential — Something presented with a request to prove that the sender is a particular identity, such as a password or a generated key.
Checking sign-in…
Loading comments…






