Skip to main content

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)

Metadata

Release files for openai-api-availability-test 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openai-api-availability-test 0.1.0
File Size Uploaded
openai_api_availability_test-0.1.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openai-api-availability-test 0.1.0
File Interpreter ABI Platform
openai_api_availability_test-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 7.4 kB

Release files / openai_api_availability_test-0.1.0.tar.gz

Download URL openai_api_availability_test-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
39696f57bcebeb8de09c7afd5fca4937c90e1881c59ac427158919d65140b7a7
BLAKE2b-256 checksum
How to use checksums
20896b2455f04c5df428a0a5c55ffeb4717781fa5d85b1693c532d8b913ecf40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release files / openai_api_availability_test-0.1.0-py3-none-any.whl

Download URL openai_api_availability_test-0.1.0-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fef26aa4322d64cdc8115253675f1d0c5c8f2400bc3be1bc4d0805af7e9c5a52
BLAKE2b-256 checksum
How to use checksums
196bb5026171e6d119efb8859cb45b6e5818abaa6b4cf5bca742a1d591e8d4dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Windows/10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page