API timeout after inactivity (python)

When my python program doesn’t use the API for couple of hours or days, the next time it does, very often the API time-outs by APIConnectionError Exception after minutes of inactivity.
After that, it is back to normal and it responds swiftly.
If I restart the program after such delay before using the API, it typically answers swiftly as well.

Happens both to chat completion and transcribe by whisper-1.

Does anybody encounter such behavior as well?
Why is that?
Any idea how to fix it?

Thanks, m