Metadata-Version: 2.5
Name: aiollm-openai
Version: 0.16.0
Summary: OpenAI's Responses and Files APIs for aiollm
Project-URL: Homepage, https://github.com/aiollm-org/aiollm_openai
Project-URL: Documentation, https://aiollm-org.github.io/aiollm/
Project-URL: Repository, https://github.com/aiollm-org/aiollm_openai
Project-URL: Issues, https://github.com/aiollm-org/aiollm_openai/issues
Project-URL: Changelog, https://github.com/aiollm-org/aiollm_openai/blob/master/CHANGELOG.md
Author-email: GrehBan <maximfeedback19@gmail.com>
Maintainer-email: GrehBan <maximfeedback19@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,aiohttp,api-client,async,asyncio,llm,openai,pydantic,responses-api,streaming,typed
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: AsyncIO
Classifier: Framework :: Pydantic :: 2
Classifier: Framework :: aiohttp
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: aiollm-core<0.17,>=0.16
Requires-Dist: pydantic>=2.14.1
Description-Content-Type: text/markdown

# aiollm-openai

OpenAI's Responses and Files APIs for [aiollm](https://github.com/aiollm-org/aiollm), the async-first toolkit for typed HTTP API clients.

`OpenAIClient` sends OpenAI's own methods (`CreateResponse`, `StreamResponse` and the five Files methods) with types generated from OpenAI's official OpenAPI file, and has aiollm's provider-neutral `client.generation` and `client.files`, so code written for any aiollm provider runs on it.

> **Status: pre-alpha.** The package was part of aiollm up to 0.14.0 as `aiollm.providers.openai`; it is now `aiollm_openai`. Its public API may still change: before 1.0 a breaking change bumps the minor version.

## Installation

The package requires Python 3.13 or newer and installs the core it needs, [aiollm-core](https://pypi.org/project/aiollm-core/):

```bash
pip install aiollm-openai
```

Or with uv: `uv add aiollm-openai`. To work on the package itself, see [CONTRIBUTING.md](CONTRIBUTING.md).

## Quick start

`OpenAIClient()` reads the key from `OPENAI_API_KEY`; pass a token to give it yourself.

```python title="quick_start.py"
from aiollm_openai import OpenAIClient


async def ask() -> str:
    async with OpenAIClient() as client:
        response = await client.generation.create(
            model="gpt-6-astra",
            input="Hi",
            instructions="Be brief",
        )
    return response.text
```

Run it with `asyncio.run(ask())`.

## Documentation

The guide and the API reference are on the aiollm site, **[aiollm-org.github.io/aiollm](https://aiollm-org.github.io/aiollm/)**: [provider clients](https://aiollm-org.github.io/aiollm/guide/providers/), [shared generation](https://aiollm-org.github.io/aiollm/guide/generation/) and [files](https://aiollm-org.github.io/aiollm/guide/files/). The changes up to 0.14.0 are in [aiollm's changelog](https://github.com/aiollm-org/aiollm/blob/master/CHANGELOG.md); the later ones in [CHANGELOG.md](CHANGELOG.md).

## License

MIT. See [LICENSE](LICENSE).
