z-ai-sdk-python/examples/check_apikey_env.py
wellenzheng 7562c00dae
fix: update video generation params and examples (#10)
Co-authored-by: zhengweijun <weijun.zheng@aminer.cn>
2025-07-22 17:23:32 +08:00

14 lines
No EOL
348 B
Python

import os
def check_apikey():
api_key = os.getenv('ZAI_API_KEY')
if api_key and api_key.strip():
print('ZAI_API_KEY is set.')
print(api_key)
else:
print('ZAI_API_KEY is NOT set. Please set the ZAI_API_KEY environment variable or configure it in the .env file.')
if __name__ == '__main__':
check_apikey()