Apirelio FastAPI SDK
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apirelio_fastapi-0.2.0.tar.gz.
File metadata
- Download URL: apirelio_fastapi-0.2.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce4a1c23e8269d5aadce1ccf2ebef6b399efe6a281bc39623f68baf8fda8312
|
|
| MD5 |
bbfc0200ecce976cd0da43b92b9e316e
|
|
| BLAKE2b-256 |
fa3bf84be2da70effd8c25b135b716213c1f78c03a495c75f4a0b953ee44d5f0
|
Provenance
The following attestation bundles were made for apirelio_fastapi-0.2.0.tar.gz:
Publisher:
release-packages.yml on pryznar/apirelio-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apirelio_fastapi-0.2.0.tar.gz -
Subject digest:
8ce4a1c23e8269d5aadce1ccf2ebef6b399efe6a281bc39623f68baf8fda8312 - Sigstore transparency entry: 2304561645
- Sigstore integration time:
-
Permalink:
pryznar/apirelio-app@1c84d6d2681d542f50b7711063472fda6fe7ac88 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pryznar
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-packages.yml@1c84d6d2681d542f50b7711063472fda6fe7ac88 -
Trigger Event:
release
-
Statement type:
File details
Details for the file apirelio_fastapi-0.2.0-py3-none-any.whl.
File metadata
- Download URL: apirelio_fastapi-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75abab6ef7d30e776e467688cc41a44a4c9d65aa6bcb94975400073b69a81337
|
|
| MD5 |
9d3a3b97aad78d0ebb0947954a1cb8fe
|
|
| BLAKE2b-256 |
be3b9af471d2ac1379edd1ea3052716baa8ae05b4b7a4a91730646d9119feb11
|
Provenance
The following attestation bundles were made for apirelio_fastapi-0.2.0-py3-none-any.whl:
Publisher:
release-packages.yml on pryznar/apirelio-app
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apirelio_fastapi-0.2.0-py3-none-any.whl -
Subject digest:
75abab6ef7d30e776e467688cc41a44a4c9d65aa6bcb94975400073b69a81337 - Sigstore transparency entry: 2304561889
- Sigstore integration time:
-
Permalink:
pryznar/apirelio-app@1c84d6d2681d542f50b7711063472fda6fe7ac88 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/pryznar
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-packages.yml@1c84d6d2681d542f50b7711063472fda6fe7ac88 -
Trigger Event:
release
-
Statement type: