Spaces:
Sleeping
Sleeping
Download app/misc/test_API.py from zenivan/LogoKonspekt_core: direct link, hf CLI and curl.
- Browser
- Download file 362 Bytes
-
https://huggingface.co/spaces/zenivan/LogoKonspekt_core/resolve/main/app/misc/test_API.py
- Command line
-
hf download hf://spaces/zenivan/LogoKonspekt_core/app/misc/test_API.py
-
curl -L -o test_API.py https://huggingface.co/spaces/zenivan/LogoKonspekt_core/resolve/main/app/misc/test_API.py
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 | |