That simply means that the validation, introduced at version 1.26 and performed by the actual API SDK version being employed, is not available in your version number actually in use as you expect.
Add to the start of your script to see the source of the problem:
from openai import __version__ as oai_version
if int(oai_version.split(".")[0])<1 or (
int(oai_version.split(".")[0])<2 and int(oai_version.split(".")[1])<26
):
raise ValueError(f"OpenAI version {oai_version} too low for streamed usage report")
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type âhelpâ, âcopyrightâ, âcreditsâ or âlicenseâ for more information.
from openai import version as oai_version
oai_version
â1.52.1â