metronome-sdk
The official Python library for the metronome API
What it is and what it does
Metronome SDK is the official Python client for the Metronome billing and usage API. It wraps the REST API with full type annotations (TypedDicts for requests, Pydantic models for responses), offering both synchronous and asynchronous clients powered by httpx. The library handles authentication via bearer token, provides auto-paginating iterators for list endpoints, and includes error handling for connection and API status issues.
Typical use is ingesting usage events (with transaction IDs, customer IDs, timestamps, and custom properties), querying contracts and products, and managing billing configurations. The async client can optionally use aiohttp as its HTTP backend for improved concurrency. All responses include helper methods for JSON serialization and dictionary conversion, and the library supports modern Python versions from 3.9 onward.
Use it for:
- Ingest usage events (CPU seconds, API calls, storage) into Metronome for billing calculations.
- Query contracts and products with automatic pagination across result sets.
- Build billing integrations in async applications using AsyncMetronome with httpx or aiohttp.
- Manage customer billing configurations and retrieve typed responses with IDE autocomplete.
- Handle API errors gracefully with specific exception types for connection and status failures.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python client library for the Metronome REST API with full type definitions, supporting both synchronous and asynchronous operations via httpx.
Yes. This is the official, actively maintained SDK for a billing platform API, with low install friction, permissive licensing, no known vulnerabilities, and comprehensive type support. Install it if you need to integrate with Metronome's usage ingestion or billing APIs from Python.
Install
metronome-sdk on PyPI
pip
pip install metronome-sdkuv
uv add metronome-sdkpoetry
poetry add metronome-sdkInstalling metronome-sdk
Before you install
Low install friction with a pure-Python wheel. Actively maintained with a recent release 22 days ago. Supports modern Python versions (3.9 through 3.14) and declares all dependencies explicitly.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most production environments.
Quickstart
pip install metronome-sdk
import os
from metronome import Metronome
client = Metronome(
bearer_token=os.environ.get("METRONOME_BEARER_TOKEN")
)
client.v1.usage.ingest(
usage=[{
"transaction_id": "90e9401f-0f8c-4cd3-9a9f-d6beb56d8d72",
"customer_id": "team@example.com",
"event_type": "heartbeat",
"timestamp": "2024-01-01T00:00:00Z",
"properties": {"cpu_seconds": 60}
}]
)
Requires METRONOME_BEARER_TOKEN environment variable or explicit bearer_token parameter to authenticate with the Metronome API.
Verify before relying
- Whether the library's auto-pagination handles all edge cases and rate-limit scenarios correctly.
- Performance characteristics when ingesting high-volume usage events or handling large paginated responses.
- Stability and feature completeness of the MCP Server integration mentioned in the description.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions |
| Maintenance | actively maintained — 22 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 492,267/month — #6,361 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: metronome_sdk-4.10.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
modern-treasuryProvides a typed Python client library for the…
permissive · top 15,000 on PyPI
supermemoryProvides a Python client library for the…
permissive · top 15,000 on PyPI
composio-clientA Python client library for the Composio REST…
permissive · top 5,000 on PyPI
agentex-clientProvides a typed Python REST client for the…
permissive · top 15,000 on PyPI
vapi-server-sdkA Python SDK for the Vapi API, providing…
unclear · top 15,000 on PyPI
python-intercomA Python client library for the Intercom API,…
unclear · top 15,000 on PyPI
runloop_api_clientA Python client library for the Runloop REST…
permissive · top 5,000 on PyPI
opencode-aiProvides a Python client library for the…
permissive · top 15,000 on PyPI
sambanovaProvides a Python client library for accessing…
permissive · top 15,000 on PyPI
pipedreamProvides a Python client library for accessing…
unclear · top 15,000 on PyPI