Metadata-Version: 2.5
Name: gushwork-relay
Version: 0.2.1
Summary: The OpenAI Python SDK with Relay's headers and stored prompts.
Project-URL: Homepage, https://github.com/gushwork/project-zero/tree/main/sdk/python
Project-URL: Source, https://github.com/gushwork/project-zero/tree/main/sdk/python
Project-URL: Issues, https://github.com/gushwork/project-zero/issues
License: Proprietary
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: openai<4,>=2.6
Description-Content-Type: text/markdown

# gushwork-relay

The Python SDK for the Relay gateway. It is the official OpenAI SDK with Relay's headers and stored prompts added, so chat completions, the Responses API, embeddings, streaming, retries and typed errors work as they do in the OpenAI SDK.

## Install

```bash
pip install gushwork-relay
```

Python 3.10 or later.

## Quickstart

Set your Relay API key, your gateway URL and the id of a config:

```bash
export RELAY_API_KEY=...
export RELAY_BASE_URL=https://<your-gateway-host>/v1
export RELAY_CONFIG=...
```

```python
from relay_ai import Relay

client = Relay()  # reads the three variables above

reply = client.chat.completions.create(
    model="gpt-4.1-mini",
    messages=[{"role": "user", "content": "Say hello in five words."}],
)
print(reply.choices[0].message.content)

# A prompt stored in Relay: its template, model and variables.
reply = client.prompts.completions.create(prompt="support-reply@staging", variables={"customer": "Ana"})
print(reply.choices[0].message.content)
```

`AsyncRelay` is the asynchronous client. Both take `api_key`, `base_url`, `config`, `metadata` and `trace_id` as arguments.

## Documentation

The full guide is in the SDKs section of the Relay docs: <https://docs.gushwork.org/sdks/>.
