Spaces:
Sleeping
Sleeping
File size: 362 Bytes
58a9b80 76ed735 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | import requests
API_KEY = ""
headers = {
"Authorization": f"Bearer {API_KEY}"
}
response = requests.get("https://api.openai.com/v1/models", headers=headers)
print(response.status_code) # Должно быть 200, если ключ работает
print(response.json()) # Посмотрим, что вернет API
|