MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / load_api_keys

Function load_api_keys

api_utils/auth_utils.py:12–21  ·  view source on GitHub ↗

Loads API keys from the key file into the API_KEYS set.

()

Source from the content-addressed store, hash-verified

10
11
12def load_api_keys():
13 """Loads API keys from the key file into the API_KEYS set."""
14 global API_KEYS
15 API_KEYS.clear()
16 if os.path.exists(KEY_FILE_PATH):
17 with open(KEY_FILE_PATH, "r") as f:
18 for line in f:
19 key = line.strip()
20 if key:
21 API_KEYS.add(key)
22
23
24def initialize_keys():

Callers 2

test_load_api_keysFunction · 0.90
initialize_keysFunction · 0.85

Calls 1

clearMethod · 0.45

Tested by 1

test_load_api_keysFunction · 0.72