LogoKonspekt_core / app /misc /test_API.py
zenivan's picture
...
76ed735
Raw
History Blame Contribute Delete
362 Bytes
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