Skip to main content

Apirelio FastAPI SDK

Documentation · PyPI · Apirelio

Connect FastAPI errors, latency and releases to the affected customers without capturing request or response payloads.

Native FastAPI/Starlette ASGI middleware for privacy-safe, customer-aware API analytics. It uses the resolved route template and only enqueues after the response completes.

pip install apirelio-fastapi
import os

from fastapi import FastAPI
from apirelio_fastapi import install_apirelio

app = FastAPI()

install_apirelio(
    app,
    api_key=os.environ.get("APIRELIO_API_KEY", ""),
    endpoint=os.environ.get("APIRELIO_ENDPOINT", "https://apirelio.com"),
    service="billing-api",
    environment="production",
    include_routes=("/api/**",),
    exclude_routes=("/api/health", "/api/internal/**"),
    resolve_customer=lambda request: {
        "id": str(request.state.user.company_id),
        "plan": request.state.user.plan,
    } if hasattr(request.state, "user") else None,
)

The installer stores the client at app.state.apirelio and flushes it during FastAPI shutdown. Bodies, query strings, cookies, authorization values, email addresses and IP addresses are never captured. Python 3.9+, FastAPI 0.100+ and FastAPI versions below 1.0 are supported.

Metadata

Release files for apirelio-fastapi 0.2.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 apirelio-fastapi 0.2.1
File Size Uploaded
apirelio_fastapi-0.2.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apirelio-fastapi 0.2.1
File Interpreter ABI Platform
apirelio_fastapi-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.9 kB

Release files / apirelio_fastapi-0.2.1.tar.gz

Download URL apirelio_fastapi-0.2.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1d30459acc3151a26757a0bcb0baa717cb664b787fdeab2803095f7a40493cec
BLAKE2b-256 checksum
How to use checksums
719178d2ce16287bf95c9c0fce3199df4ea6d9ddc4c7615e40e502bcb65328ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release files / apirelio_fastapi-0.2.1-py3-none-any.whl

Download URL apirelio_fastapi-0.2.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5652390ede124a3fcb52e7fa719f8e56a6d5ff3c40181277c7f4c1e14b2db5a1
BLAKE2b-256 checksum
How to use checksums
e3c329043ab6c9ed1e80e94f46011fca5f3ea562c68e3ae8884dc9015d6a4b9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

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