Metadata-Version: 2.4
Name: openai-api-availability-test
Version: 0.1.0
Summary: A tiny CLI that checks whether an OpenAI API key can call Chat Completions.
Author: GGN_2015
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: openai>=2.0.0
Description-Content-Type: text/markdown

# openai-api-availability-test

A tiny CLI that checks whether an OpenAI API key can call Chat Completions.

## Usage

```bash
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:

```bash
openai-api-test --api-key "your_api_key" --model gpt-4.1-mini
```

To use another base URL:

```bash
openai-api-test --api-key "your_api_key" --base-url "https://api.openai.com/v1"
```

To use another timeout:

```bash
openai-api-test --api-key "your_api_key" --timeout 30
```

## Python API

```python
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)
```
