Skip to main content

Real-time cost control for AI and API platforms

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

Sign up now

Support

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

usageguard-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usageguard-0.1.0-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file usageguard-0.1.0.tar.gz.

File metadata

  • Download URL: usageguard-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for usageguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 45716cd26ad6ec93f3fa957e9ba9cd3f0f451038a1bc0c5bb0694672f44410c3
MD5 b33150519a2a041356e48767f3084434
BLAKE2b-256 c248a0f1a359480e6cdc733b0bca78d9825fa79764de9eba78ad4278aabb0de2

See more details on using hashes here.

File details

Details for the file usageguard-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: usageguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for usageguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ee0ac3b2cebc05cf474d915fa081c2993200a0fbf866d206615d11082a2e46
MD5 5b31587a09348709967d4d72901d3209
BLAKE2b-256 1f736bd5a738819dc1ed23f5d8677278883a60f4eef20740c745450817e12acd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page