Metadata-Version: 2.4
Name: soxai
Version: 0.1.0
Summary: SoxAI — Unified AI API Gateway client. Access 200+ AI models from 40+ providers through one OpenAI-compatible API.
Project-URL: Homepage, https://www.soxai.io
Project-URL: Documentation, https://www.soxai.io/docs
Project-URL: Repository, https://github.com/onedotnet/soxai-python
Project-URL: API Reference, https://www.soxai.io/docs/api-reference
Project-URL: Model List, https://www.soxai.io/models
Project-URL: Pricing, https://www.soxai.io/pricing
Project-URL: Changelog, https://www.soxai.io/changelog
Author-email: OneDotNet Ltd <hello@soxai.io>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,ai-gateway,anthropic,api,api-proxy,claude,claude-code,codex-cli,deepseek,gateway,gemini,llm,multi-model,openai,openrouter-alternative
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Requires-Dist: openai>=1.0.0
Description-Content-Type: text/markdown

# SoxAI Python SDK

The official Python client for [SoxAI](https://www.soxai.io) — a unified AI API gateway that gives you access to **200+ AI models** from **40+ providers** through a single OpenAI-compatible API.

## Installation

```bash
pip install soxai
```

## Quick Start

```python
from soxai import SoxAI

client = SoxAI(api_key="sox-your-key")

# Use any model from any provider — same SDK
response = client.chat.completions.create(
    model="claude-sonnet-4-6",  # or gpt-4o, gemini-2.5-flash, deepseek-chat, ...
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

## Why SoxAI?

- **One API key** for OpenAI, Anthropic, Google, DeepSeek, Meta, and 35+ more providers
- **Automatic failover** — if one provider goes down, requests route to another
- **Team management** — per-developer API keys with spending limits
- **Compatible with Claude Code, Codex CLI, Gemini CLI** — just set `ANTHROPIC_BASE_URL`
- **Free $5 credit** to start, no credit card required

## Examples

### Streaming

```python
from soxai import SoxAI

client = SoxAI(api_key="sox-your-key")

stream = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Write a haiku about APIs."}],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)
```

### Multi-Model Comparison

```python
from soxai import SoxAI

client = SoxAI(api_key="sox-your-key")

models = ["gpt-4o-mini", "claude-sonnet-4-6", "gemini-2.5-flash", "deepseek-chat"]
prompt = "Explain the CAP theorem in one sentence."

for model in models:
    r = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": prompt}],
    )
    print(f"{model}: {r.choices[0].message.content}")
```

### Image Generation

```python
from soxai import SoxAI

client = SoxAI(api_key="sox-your-key")

response = client.images.generate(
    model="dall-e-3",
    prompt="A futuristic API gateway, digital art",
    size="1024x1024",
)
print(response.data[0].url)
```

### Environment Variable

```bash
export SOXAI_API_KEY="sox-your-key"
```

```python
from soxai import SoxAI

client = SoxAI()  # reads from SOXAI_API_KEY
```

## Using with Existing OpenAI Code

Already using the OpenAI SDK? You can also just change `base_url`:

```python
from openai import OpenAI

client = OpenAI(
    api_key="sox-your-key",
    base_url="https://api.soxai.io/v1",
)
# Everything else stays the same
```

## Links

- [Website](https://www.soxai.io)
- [Documentation](https://www.soxai.io/docs)
- [Model List](https://www.soxai.io/models)
- [Pricing](https://www.soxai.io/pricing)
- [Examples](https://github.com/onedotnet/soxai-examples)
- [Sign Up (Free $5)](https://console.soxai.io/register)

## License

MIT
