Metadata-Version: 2.4
Name: impossibl
Version: 0.0.1
Summary: A minimal Python client for the Impossibl AI API.
Project-URL: Homepage, https://impossibl.com
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: openai<3,>=2

# impossibl

Impossibl is an AI gateway with self-serve inference.

Build with models from OpenAI, Anthropic, Google, and xAI through one
OpenAI-compatible API. Change the model ID to try another provider, while
keeping the same integration.

[Impossibl](https://impossibl.com) brings your models together with one API key,
unified usage and billing, and automatic provider fallbacks.

## Python client

This package is a small client for the hosted Impossibl API. It extends the
OpenAI Python client with Impossibl's endpoint and the `IMPOSSIBL_API_KEY`
environment variable.

```sh
pip install impossibl
export IMPOSSIBL_API_KEY="your-api-key"
```

List available models:

```python
from impossibl import Impossibl

with Impossibl() as client:
    for model in client.models.list():
        print(model.id)
```

Generate a response using a model ID from the list:

```python
import os
from impossibl import Impossibl

with Impossibl() as client:
    response = client.chat.completions.create(
        model=os.environ["IMPOSSIBL_MODEL"],
        messages=[{"role": "user", "content": "Hello!"}],
    )
    print(response.choices[0].message.content)
```

Set `IMPOSSIBL_MODEL` to your chosen model ID before running the second example.
Model availability, pricing, and API credentials are managed by Impossibl.
Generation requests may consume your account balance.

You can also pass `api_key` explicitly. OpenAI client options such as `timeout`,
`max_retries`, and `base_url` are forwarded unchanged. An explicit key takes
precedence over `IMPOSSIBL_API_KEY`; `OPENAI_API_KEY` is not used as a fallback.

This initial release provides a synchronous client. It does not create accounts
or manage billing. API compatibility is determined by the Impossibl service.
