Skip to main content

SoxAI Python SDK

The official Python client for SoxAI — a unified AI API gateway that gives you access to 200+ AI models from 40+ providers through a single OpenAI-compatible API.

Installation

pip install soxai

Quick Start

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

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

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

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

export SOXAI_API_KEY="sox-your-key"
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:

from openai import OpenAI

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

Links

License

MIT

Metadata

Release files for soxai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for soxai 0.1.0
File Size Uploaded
soxai-0.1.0.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for soxai 0.1.0
File Interpreter ABI Platform
soxai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / soxai-0.1.0.tar.gz

Download URL soxai-0.1.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
324394495bfc28069f22107311817aa85310be28008263b93f6af0c620d04d31
BLAKE2b-256 checksum
How to use checksums
be088391abdc11c4b6944455602f20a2a0e6bcfe78b112df821cebf9078849d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / soxai-0.1.0-py3-none-any.whl

Download URL soxai-0.1.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8eb23c5fa0eb4207002d657f997a4df942793b9b2d858eb42ba000b5a4d6b4de
BLAKE2b-256 checksum
How to use checksums
a539717d550ee4e5bcacbaf7eef3ff6869566dff859c5c3c51f47baa31efe068
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page