Usefy Python SDK - Real-time AI cost control
Project description
UsageGuard SDK
Real-time cost control for AI & API platforms. Prevent budget overruns with pre-flight checks and automatic enforcement.
Features
- ๐ก๏ธ Budget Enforcement - Block requests before they cost you money
- โก 12ms Latency - Minimal performance impact
- ๐ Fail-Open - Your app keeps running if UsageGuard is down
- ๐ Real-time Dashboard - Monitor usage and savings
- ๐ API Key Management - Secure authentication
- ๐ฏ Flexible Policies - Per-project, per-user, or custom scopes
Quick Start
1. Sign Up
Get your API key at usage-guard.vercel.app/signup
2. Install
pip install usageguard
3. Use
from usageguard import UsageGuard
from openai import OpenAI
# Initialize
guard = UsageGuard(api_key="ug_live_your_key_here")
# Wrap your client
client = guard.wrap_openai(OpenAI(api_key="your_openai_key"))
# Use normally - budgets enforced automatically
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Hello!"}]
)
Supported Providers
- โ OpenAI (GPT-4, GPT-3.5, etc.)
- โ Google Gemini (Pro, Flash, etc.)
- ๐ Anthropic Claude
- ๐ Azure OpenAI
- ๐ Custom providers
Documentation
Architecture
โโโโโโโโโโโโโโโ
โ Your App โ
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ UsageGuard SDK โ โ Pre-flight check
โโโโโโโโฌโโโโโโโโโโโ
โ
โโโ โ
Allowed โ OpenAI/Gemini
โ
โโโ โ Blocked (budget exceeded)
Performance
- Latency: 12ms avg (P99: 45ms)
- Availability: 99.9%
- Fail-open: Yes (requests proceed if API down)
Security
- SHA-256 API key hashing
- TLS encryption
- No data retention
- SOC 2 compliant (coming soon)
Pricing
- Free: 10,000 requests/month
- Pro: $29/month - 100,000 requests
- Enterprise: Custom pricing
Support
- Email: support@usageguard.ai
- GitHub: github.com/sherlocq61/UsageGuard
- Discord: discord.gg/usageguard
License
MIT License - see LICENSE
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
usefy-1.0.0.tar.gz
(16.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
usefy-1.0.0-py3-none-any.whl
(25.0 kB
view details)
File details
Details for the file usefy-1.0.0.tar.gz.
File metadata
- Download URL: usefy-1.0.0.tar.gz
- Upload date:
- Size: 16.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2038265a2a02858e550a18a37e9ab3adf7de52711ae6ba0a8c5f8fbbb3b2e0cf
|
|
| MD5 |
3778bdf4cd00e490b2f10c6801058aee
|
|
| BLAKE2b-256 |
4ed1b8de617fb2d701d486145bb218c89da9a0ea691cd750d55f05a05a05ad77
|
File details
Details for the file usefy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: usefy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91b84fb00f9b218f25b59d46cbf98289e0e29a1ca4c3e2a423486c1219e60746
|
|
| MD5 |
80c2890298cd85b21eb9212986767ea7
|
|
| BLAKE2b-256 |
c35de6409ed19ef01e6d7ddf8b154d2dd7785a9c8bb536216866847f51ce6c53
|