Usefy SDK - Thin wrapper for AI providers via Usefy proxy
Project description
Usefy 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 Usefy 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 usefy.ai/signup
2. Install
Python:
pip install usefy
JavaScript:
npm install usefy
3. Use
Python:
from usefy import UsefyClient
from openai import OpenAI
# Initialize
guard = UsefyClient(api_key="us_live_your_key_here", project_id="your_project")
# 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!"}]
)
JavaScript:
import { UsefyClient } from 'usefy';
import OpenAI from 'openai';
const guard = new UsefyClient({
apiKey: 'us_live_your_key_here',
projectId: 'your_project'
});
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const client = guard.wrapOpenAI(openai);
const response = await 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
- โ And more...
Documentation
Architecture
โโโโโโโโโโโโโโโ
โ Your App โ
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ Usefy 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
Pricing
- Free: 10,000 requests/month
- Pro: $29/month - 100,000 requests
- Enterprise: Custom pricing
Support
- Email: support@usefy.ai
- GitHub: github.com/sherlocq61/usefy
License
MIT License - USEFY LTD
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-2.0.0.tar.gz
(17.6 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-2.0.0-py3-none-any.whl
(26.4 kB
view details)
File details
Details for the file usefy-2.0.0.tar.gz.
File metadata
- Download URL: usefy-2.0.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c173a7057ece04b97ddeef9bf7024d0c5b176feeef84204293d209fdf2903939
|
|
| MD5 |
8e61a364cdf6b90db3046773303a44e1
|
|
| BLAKE2b-256 |
327efd84e71a3b317e3ce95a4f493d2e4faac00390efda53829028404ee2477c
|
File details
Details for the file usefy-2.0.0-py3-none-any.whl.
File metadata
- Download URL: usefy-2.0.0-py3-none-any.whl
- Upload date:
- Size: 26.4 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 |
6e09ce990e33cffadd3a319299046321ce0b8eea41fa0b44427900c67be32275
|
|
| MD5 |
17af40ff7d87a7aa1bcad973d19a9550
|
|
| BLAKE2b-256 |
374a6c52a9fea721a95e0ae52d934cecba69738588a8b574dbce03ce613ee93f
|