Metadata-Version: 2.4
Name: reapi-sdk
Version: 0.1.0
Summary: OpenAI-compatible SDK for the reAPI gateway (https://reapi.ai). Use the OpenAI client you already know, pointed at reAPI.
Project-URL: Homepage, https://reapi.ai
Project-URL: Repository, https://github.com/reAPIAI/reapi-python
Project-URL: Issues, https://github.com/reAPIAI/reapi-python/issues
Author: reAPI
License: MIT
License-File: LICENSE
Keywords: ai-gateway,llm,openai,openai-compatible,reapi,sdk
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: openai>=1.0
Description-Content-Type: text/markdown

# reapi

OpenAI-compatible SDK for the [reAPI](https://reapi.ai) gateway.

reAPI speaks the OpenAI API. This package is a thin wrapper around the official
`openai` client, pre-pointed at `https://api.reapi.ai/v1` — so you keep every
method, type, and streaming helper you already know.

## Install

```bash
pip install reapi-sdk
```

## Quick start

```python
from reapi_sdk import create_reapi

# Reads your key from REAPI_API_KEY, or pass api_key=...
client = create_reapi()

# Models are discovered at runtime — nothing is hard-coded:
models = client.models.list()

res = client.chat.completions.create(
    model=models.data[0].id,
    messages=[{"role": "user", "content": "Hello from reAPI"}],
)
print(res.choices[0].message.content)
```

### Streaming

```python
stream = client.chat.completions.create(
    model="<model-id>",
    messages=[{"role": "user", "content": "Stream this"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")
```

## API key

Get an API key at [reapi.ai](https://reapi.ai). Provide it either way:

```python
client = create_reapi(api_key="YOUR_KEY")
```

```bash
export REAPI_API_KEY=YOUR_KEY
```

## License

MIT
