[PR #236] [MERGED] Implement usage-based subscription and monitoring #271

Closed
opened 2026-03-02 23:34:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/236
Author: @AJaySi
Created: 9/4/2025
Status: Merged
Merged: 9/12/2025
Merged by: @AJaySi

Base: mainHead: cursor/implement-usage-based-subscription-and-monitoring-0179


📝 Commits (7)

  • e0a6150 Add comprehensive usage-based subscription system with API tracking
  • b156298 Merge branch 'main' into cursor/implement-usage-based-subscription-and-monitoring-0179
  • 1b65a94 ALwrity LinkedIn Writer: Billing Dashboard: Compact View, Billing Overview, System Health Indicator, Cost Breakdown, Usage Trends, Usage Alerts, Comprehensive API Breakdown
  • c0a3662 Added blog writer implementation - WIP
  • 2ae0c4a AI Blog Writer - Implement modular architecture with research, outline, and core services
  • 1d04d64 Merge main into cursor/implement-usage-based-subscription-and-monitoring-0179
  • c63148e Add comprehensive Stage 3 Content Generation implementation plan

📊 Changes

140 files changed (+20468 additions, -191 deletions)

View changed files

backend/BILLING_SYSTEM_INTEGRATION.md (+256 -0)
backend/SUBSCRIPTION_SYSTEM_README.md (+372 -0)
backend/api/blog_writer/__init__.py (+2 -0)
backend/api/blog_writer/router.py (+359 -0)
backend/api/subscription_api.py (+414 -0)
📝 backend/app.py (+13 -0)
📝 backend/middleware/monitoring_middleware.py (+249 -9)
backend/models/__pycache__/linkedin_models.cpython-313.pyc (+0 -0)
backend/models/blog_models.py (+149 -0)
backend/models/subscription_models.py (+316 -0)
backend/research_analysis_20250911_173832.json (+84 -0)
backend/research_analysis_20250911_174238.json (+206 -0)
backend/scripts/create_billing_tables.py (+217 -0)
backend/scripts/create_subscription_tables.py (+206 -0)
backend/services/blog_writer/README.md (+151 -0)
backend/services/blog_writer/blog_service.py (+11 -0)
backend/services/blog_writer/core/__init__.py (+11 -0)
backend/services/blog_writer/core/blog_writer_service.py (+233 -0)
backend/services/blog_writer/outline/__init__.py (+21 -0)
backend/services/blog_writer/outline/outline_generator.py (+351 -0)

...and 80 more files

📄 Description

Implement a usage-based subscription system with API call monitoring, cost tracking, and usage limits to enable billing and control consumption.

This PR introduces a foundational usage-based subscription model, integrating real-time API call monitoring, cost calculation, and limit enforcement directly into the application's middleware. This enables the platform to accurately track user consumption of external APIs (like Gemini, OpenAI, etc.), apply subscription-based caps, and provide detailed billing statistics for the new business model.


Open in Cursor Open in Web

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/236 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 9/4/2025 **Status:** ✅ Merged **Merged:** 9/12/2025 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `cursor/implement-usage-based-subscription-and-monitoring-0179` --- ### 📝 Commits (7) - [`e0a6150`](https://github.com/AJaySi/ALwrity/commit/e0a6150ed174065b95f64c9f9b0ac9c99aa01773) Add comprehensive usage-based subscription system with API tracking - [`b156298`](https://github.com/AJaySi/ALwrity/commit/b156298e82c93c499cac973f551e20e9b429997b) Merge branch 'main' into cursor/implement-usage-based-subscription-and-monitoring-0179 - [`1b65a94`](https://github.com/AJaySi/ALwrity/commit/1b65a9487baa5722b7ad8e602e815e6ac04b349b) ALwrity LinkedIn Writer: Billing Dashboard: Compact View, Billing Overview, System Health Indicator, Cost Breakdown, Usage Trends, Usage Alerts, Comprehensive API Breakdown - [`c0a3662`](https://github.com/AJaySi/ALwrity/commit/c0a366269d51bdedb90fd3c9608f797085a05bc2) Added blog writer implementation - WIP - [`2ae0c4a`](https://github.com/AJaySi/ALwrity/commit/2ae0c4a8b9122d3d8618e189bd12cd2a74e6777f) AI Blog Writer - Implement modular architecture with research, outline, and core services - [`1d04d64`](https://github.com/AJaySi/ALwrity/commit/1d04d64d952ffed831b9037a2c9d8881e0dca2ab) Merge main into cursor/implement-usage-based-subscription-and-monitoring-0179 - [`c63148e`](https://github.com/AJaySi/ALwrity/commit/c63148e1ce9f892aa53427ce8bc787d6ce59b275) Add comprehensive Stage 3 Content Generation implementation plan ### 📊 Changes **140 files changed** (+20468 additions, -191 deletions) <details> <summary>View changed files</summary> ➕ `backend/BILLING_SYSTEM_INTEGRATION.md` (+256 -0) ➕ `backend/SUBSCRIPTION_SYSTEM_README.md` (+372 -0) ➕ `backend/api/blog_writer/__init__.py` (+2 -0) ➕ `backend/api/blog_writer/router.py` (+359 -0) ➕ `backend/api/subscription_api.py` (+414 -0) 📝 `backend/app.py` (+13 -0) 📝 `backend/middleware/monitoring_middleware.py` (+249 -9) ➖ `backend/models/__pycache__/linkedin_models.cpython-313.pyc` (+0 -0) ➕ `backend/models/blog_models.py` (+149 -0) ➕ `backend/models/subscription_models.py` (+316 -0) ➕ `backend/research_analysis_20250911_173832.json` (+84 -0) ➕ `backend/research_analysis_20250911_174238.json` (+206 -0) ➕ `backend/scripts/create_billing_tables.py` (+217 -0) ➕ `backend/scripts/create_subscription_tables.py` (+206 -0) ➕ `backend/services/blog_writer/README.md` (+151 -0) ➕ `backend/services/blog_writer/blog_service.py` (+11 -0) ➕ `backend/services/blog_writer/core/__init__.py` (+11 -0) ➕ `backend/services/blog_writer/core/blog_writer_service.py` (+233 -0) ➕ `backend/services/blog_writer/outline/__init__.py` (+21 -0) ➕ `backend/services/blog_writer/outline/outline_generator.py` (+351 -0) _...and 80 more files_ </details> ### 📄 Description Implement a usage-based subscription system with API call monitoring, cost tracking, and usage limits to enable billing and control consumption. This PR introduces a foundational usage-based subscription model, integrating real-time API call monitoring, cost calculation, and limit enforcement directly into the application's middleware. This enables the platform to accurately track user consumption of external APIs (like Gemini, OpenAI, etc.), apply subscription-based caps, and provide detailed billing statistics for the new business model. --- <a href="https://cursor.com/background-agent?bcId=bc-1300a582-ad91-4e42-a4a9-d21b1cada3ea"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"> <img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"> </picture> </a> <a href="https://cursor.com/agents?id=bc-1300a582-ad91-4e42-a4a9-d21b1cada3ea"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"> <img alt="Open in Web" src="https://cursor.com/open-in-web.svg"> </picture> </a> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:34:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#271
No description provided.