Quota Python SDK (quota-sdk)
Official Python SDK for Quota: Unified LLM Observability, Cost Tracking, Proxy & Model Context Protocol (MCP) Interception.
🚀 Installation
pip install quota-sdk
⚙️ Quickstart
from quota import Quota
# 1. Initialize Quota
Quota.init(
api_key="quota_live_YOUR_API_KEY",
endpoint="https://api.quota.ai/collector", # Optional (default: official endpoint)
project="ecommerce-portal",
agent="customer-support-bot",
environment="production"
)
🧠 Model Context Protocol (MCP) Integration
Option A: Wrap an MCP Client
from quota import Quota
# Wrap any Python MCP Client (e.g. mcp client, fastmcp, etc.)
mcp_client = Quota.wrap_mcp(my_raw_mcp_client, tags=["mcp", "db-tools"])
# Calls to call_tool are transparently intercepted and logged to Quota!
result = mcp_client.call_tool(name="query_orders", user_id="usr_123")
Option B: Functional Interceptor
from quota import Quota
import openai
response = Quota.intercept_mcp(
action=lambda: openai.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}]
),
provider="openai",
model="gpt-4o-mini",
tags=["mcp-action"]
)
Manual Tracking
Quota.track_usage({
"provider": "google",
"model": "gemini-2.0-flash",
"promptTokens": 120,
"completionTokens": 35,
"cachedTokens": 20,
"latencyMs": 410,
"statusCode": 200,
"success": True,
"metadata": {
"project": "bi-reports",
"agent": "analyst-bot"
}
})
🎯 Supported LLM Providers
- OpenAI (
gpt-4o,gpt-4o-mini,o1,o3-mini, etc.) - Anthropic Claude (
claude-3-5-sonnet,claude-3-haiku, etc.) - Google Gemini (
gemini-2.0-flash,gemini-1.5-pro, etc.) - Groq (
llama-3.3-70b-versatile,mixtral-8x7b, etc.) - Mistral (
mistral-large-latest,codestral, etc.)
License
MIT
Metadata
Release files for quota-sdk 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quota_sdk-1.1.0.tar.gz | 4.8 kB | Without provenance | Details for quota_sdk-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quota_sdk-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for quota_sdk-1.1.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / quota_sdk-1.1.0.tar.gz
| Download URL | quota_sdk-1.1.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d20748f02b9849f4158ef8f53d48fb9f8862b0ea1d08a0aa66636e8bd15e7c5
|
|
BLAKE2b-256 checksum How to use checksums |
094e16f2097e8c3a93dfa47672402ae69b1610d77da3c8a4bf9267899d6cf794
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Release files / quota_sdk-1.1.0-py3-none-any.whl
| Download URL | quota_sdk-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36fc8f10ffc84cefded5d4fd652ed928056b17fe1952f6a0df7c316a62563704
|
|
BLAKE2b-256 checksum How to use checksums |
35e3bd44281add742c4a217d50a4b764a49f67791797949f24ccd867609ab1b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|
Security for quota-sdk 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.