Skip to main content

🐍 Quota Python SDK (quota-sdk)

PyPI version License: MIT

🇺🇸 English | 🇧🇷 Português


🇺🇸 English

Official Python SDK for Quota: Unified LLM Observability, Real-time Cost Tracking, Proxy & native Model Context Protocol (MCP) tool interception for Python applications and agents.

🎯 Supported AI Providers

The Quota platform supports and monitors all models from the following AI providers:

  • OpenAI
  • Anthropic
  • Google
  • Groq
  • Mistral

🚀 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",
    debug=False
)

🧠 Model Context Protocol (MCP) Integration

Option A: Wrap an MCP Client

from quota import Quota

# Wrap any Python MCP Client
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

response = Quota.intercept_mcp(
    action=lambda: call_my_ai_function(),
    provider="anthropic",
    tags=["mcp-action"]
)

Manual Tracking

from quota import Quota

Quota.track_usage({
    "provider": "google",
    "model": "gemini-model",
    "promptTokens": 120,
    "completionTokens": 35,
    "cachedTokens": 20,
    "latencyMs": 410,
    "statusCode": 200,
    "success": True,
    "metadata": {
        "project": "bi-reports",
        "agent": "analyst-bot"
    }
})

🇧🇷 Português

SDK oficial em Python do Quota: Observabilidade unificada de LLMs, monitoramento de custos em tempo real, proxy e interceptação nativa de ferramentas do Model Context Protocol (MCP) para aplicações e agentes em Python.

🎯 Provedores de IA Suportados

A plataforma Quota suporta e monitora modelos dos seguintes provedores:

  • OpenAI
  • Anthropic
  • Google
  • Groq
  • Mistral

🚀 Instalação

pip install quota-sdk

⚙️ Inicialização Rápida

from quota import Quota

Quota.init(
    api_key="quota_live_sua_chave_aqui",
    endpoint="https://sua-api.com/collector",  # Opcional (padrão: rota oficial)
    project="portal-vendas",
    agent="assistente-atendimento",
    environment="production"
)

🧠 Integração com Model Context Protocol (MCP)

Opção A: Envelopando um Cliente MCP

from quota import Quota

# Envelopa qualquer cliente MCP em Python
mcp_client = Quota.wrap_mcp(meu_mcp_client, tags=["mcp", "ferramentas-db"])

# As chamadas a call_tool são automaticamente interceptadas e gravadas no Quota!
resultado = mcp_client.call_tool(name="consultar_pedidos", user_id="usr_123")

Opção B: Interceptador Funcional

from quota import Quota

resposta = Quota.intercept_mcp(
    action=lambda: minha_funcao_ia(),
    provider="openai",
    tags=["mcp-action"]
)

Envio Manual de Telemetria

from quota import Quota

Quota.track_usage({
    "provider": "google",
    "model": "gemini-model",
    "promptTokens": 120,
    "completionTokens": 35,
    "cachedTokens": 20,
    "latencyMs": 410,
    "statusCode": 200,
    "success": True,
    "metadata": {
        "project": "relatorios-bi",
        "agent": "bot-analista"
    }
})

📄 Licença / License

MIT © Quota

Metadata

Release files for quota-sdk 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quota-sdk 1.1.1
File Size Uploaded Provenance Actions
quota_sdk-1.1.1.tar.gz 5.5 kB Without provenance Details for quota_sdk-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quota-sdk 1.1.1
File Interpreter ABI Platform Actions
quota_sdk-1.1.1-py3-none-any.whl Python 3 none any Details for quota_sdk-1.1.1-py3-none-any.whl

Total release size: 10.8 kB

Release files / quota_sdk-1.1.1.tar.gz

Download URL quota_sdk-1.1.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
32452f1396a090897bf117ac045ea84faffb63af57228098ba1dbc04d169494a
BLAKE2b-256 checksum
How to use checksums
8cc2fd22e4312272d0fdf052e3996ee602efec6779bdae38dc35bcc3a389441d
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.1-py3-none-any.whl

Download URL quota_sdk-1.1.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19256bc53a55371f83ab23dc26bb5d378014a9f980cbe3bbdc98c69a1688cdea
BLAKE2b-256 checksum
How to use checksums
72be4c22e18e034bb115039ea40d1a5010eba64ec7614c385a562fb545b77636
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page