I am using the open-ai python library. How can I enable logging of HTTP request/response/headers for all calls made to open-ai?
I am not able to find anything specific in the API docs.
You can enable debug logging through an environment variable:
export OPENAI_LOG=debug
Note that this also enables httpx logging. If you want to log response data, you'll need to customize the http_client (example here)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With