Metadata-Version: 2.4
Name: spendguardco
Version: 0.3.0
Summary: SpendGuard SDK: route every AI API call through SpendGuard with one line
Home-page: https://spendguard.co
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: httpx
Requires-Dist: httpx; extra == "httpx"
Provides-Extra: requests
Requires-Dist: requests; extra == "requests"
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# spendguardco

Route every AI API call through [SpendGuard](https://spendguard.co) with one line. No base URL juggling, no code changes in your OpenAI / Anthropic / Gemini calls.

```bash
pip install spendguardco
```

```python
import spendguardco
spendguardco.guard()
```

`guard()` reads one SpendGuard proxy key per provider from the environment:

```
SPENDGUARD_OPENAI_KEY=sg_...
SPENDGUARD_ANTHROPIC_KEY=sg_...
SPENDGUARD_GOOGLE_KEY=sg_...
```

From then on every call the official `openai`, `anthropic` or `google-genai` SDK makes (and any plain `httpx` or `requests` call to those APIs) goes to the SpendGuard proxy with your `sg_` key. Your real provider keys stay encrypted in SpendGuard. Providers without an `sg_` key are left untouched, so nothing breaks half-way.

Explicit config:

```python
spendguardco.guard(
    keys={"openai": "sg_...", "anthropic": "sg_..."},
    server="https://app.spendguard.co",
)
```

Supported upstreams: OpenAI, Anthropic, Google Gemini, fal, ElevenLabs, HeyGen, Replicate, Runway, Stability, Mistral, Groq, DeepSeek, xAI, Perplexity, Together, OpenRouter.

Prefer environment variables over monkey-patching? Use the CLI instead: `npx spendguardco configure`.
