Skip to main content

meterbase

Python SDK for Meterbase: usage limits, credits and plan entitlements for your app. A sync client and an async one with the same calls, for Python 3.10+.

Install

pip install meterbase

Usage

Check before the work, track after it:

import os

from meterbase import Meterbase

meterbase = Meterbase(api_key=os.environ["METERBASE_API_KEY"])

result = meterbase.check(customer_id="acct_1", meter_id="ai_tokens", quantity=50_000)
if not result.allowed:
    raise RuntimeError(f"Refused: {result.reason}")

completion = generate(prompt)

meterbase.track(
    customer_id="acct_1",
    meter_id="ai_tokens",
    quantity=completion.usage.total_tokens,
)

For asyncio, use AsyncMeterbase and await each call. Use a sandbox key (mb_sk_test_…) for development, CI and staging.

Documentation

Everything else is in the docs:

  • Quickstart
  • Python SDK reference: client options, check, track, reserve, customers, meters, plans, billing, webhooks, errors and retries
  • Guides: gating an LLM call, holding capacity, selling top-ups, FastAPI, Stripe and more
  • Changelog: what each version adds or breaks

Metadata

Release files for meterbase 0.8.2

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

Source distribution (sdist)

Source distribution for meterbase 0.8.2
File Size Uploaded Provenance
meterbase-0.8.2.tar.gz 60.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for meterbase 0.8.2
File Interpreter ABI Platform
meterbase-0.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 140.9 kB

Release files / meterbase-0.8.2.tar.gz

Download URL meterbase-0.8.2.tar.gz
Size 60.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cfa075531983226afd957e18c6f80ae08a64a483a38116a27cb4909d4bd92c12
BLAKE2b-256 checksum
How to use checksums
60f1080abe718ec3b89c5785ab10e175528dece8b17077e11ccdb0c6a75a6775
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / meterbase-0.8.2-py3-none-any.whl

Download URL meterbase-0.8.2-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fb6c441bd47da4f5601633c846384f00c2f9d53e48262b6f9c4e539f62f5df7
BLAKE2b-256 checksum
How to use checksums
6ed9d033db40cb9e11bd8f6f9bb1905ab36908d9f218da871a157d3a051febfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for meterbase 0.8.2

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for meterbase-0.8.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

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