A tiny CLI that checks whether an OpenAI API key can call Chat Completions.
Project description
openai-api-availability-test
A tiny CLI that checks whether an OpenAI API key can call Chat Completions.
Usage
pip install -e openai-api-availability-test
openai-api-test --api-key "your_api_key"
The test uses gpt-4.1-nano by default, asks for only one output token,
uses https://api.openai.com/v1/ as the default base URL, and has a
10-second timeout.
To use another model:
openai-api-test --api-key "your_api_key" --model gpt-4.1-mini
To use another base URL:
openai-api-test --api-key "your_api_key" --base-url "https://api.openai.com/v1"
To use another timeout:
openai-api-test --api-key "your_api_key" --timeout 30
Python API
from openai_api_availability_test import check_availability
available = check_availability(
api_key="your_api_key",
base_url="https://api.openai.com/v1/",
timeout=30,
)
print(available)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openai_api_availability_test-0.1.0.tar.gz.
File metadata
- Download URL: openai_api_availability_test-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39696f57bcebeb8de09c7afd5fca4937c90e1881c59ac427158919d65140b7a7
|
|
| MD5 |
f3cc40f1d9b2b2d5996d682afe361c31
|
|
| BLAKE2b-256 |
20896b2455f04c5df428a0a5c55ffeb4717781fa5d85b1693c532d8b913ecf40
|
File details
Details for the file openai_api_availability_test-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openai_api_availability_test-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fef26aa4322d64cdc8115253675f1d0c5c8f2400bc3be1bc4d0805af7e9c5a52
|
|
| MD5 |
38e2138c2ec0de13c5058984b002e64e
|
|
| BLAKE2b-256 |
196bb5026171e6d119efb8859cb45b6e5818abaa6b4cf5bca742a1d591e8d4dd
|