FastAPI middleware for UsageFlow - Usage-based pricing made simple
Project description
UsageFlow FastAPI
FastAPI middleware for UsageFlow - Usage-based pricing made simple.
Installation
pip install usageflow-fastapi
Usage
from fastapi import FastAPI
from usageflow.fastapi import UsageFlowMiddleware
app = FastAPI()
# Initialize UsageFlow middleware
app.add_middleware(UsageFlowMiddleware, api_key="your-api-key")
@app.get("/")
async def home():
return {"message": "Hello World!"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
Features
- Automatic usage tracking
- Request/response logging
- Rate limiting
- User identification
- Custom metadata support
- Async support
Documentation
For full documentation, visit https://docs.usageflow.io
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
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 usageflow_fastapi-0.1.1.tar.gz.
File metadata
- Download URL: usageflow_fastapi-0.1.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2629be0742f64c44a88023d58d1265da2d5d9155475e79fbbf3df9eff37b9447
|
|
| MD5 |
8c0438844e173bed4302c68d6fc11454
|
|
| BLAKE2b-256 |
4f0493e60861bce513992fb2cde9e8c93dd66851c4bbb74270bb1a386256ceb3
|
File details
Details for the file usageflow_fastapi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: usageflow_fastapi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a39f1c98f35ca6dfaed3ce78875f1e62dcc28a42bf085ce4063fdd755ef6e62e
|
|
| MD5 |
7772f6b58e34e1128ee9898191db75c4
|
|
| BLAKE2b-256 |
ef6ce9ac449176a9f5436c5cda246949e9fd33dda2953078b5ae714f3a708576
|