Python SDK token refresh hanging in Terraform provider dev

I’m building a custom Terraform provider wrapper for Genesys Cloud using the Python SDK. Trying to automate token refresh so I don’t have to manually call refresh_token() in my code. The SDK docs mention an auto-refresh mechanism, but I can’t find the exact config flag. Currently my script hangs on the second API call with a 401 Unauthorized error. Anyone got a snippet showing how to enable this in the ApiClient init?