tokens ocnifg 1000 per credit adn fix

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-26 01:25:25 +00:00
parent 33b4454f96
commit 544a397e3d
5 changed files with 243 additions and 0 deletions

View File

@@ -0,0 +1,179 @@
# IGNY8 Pricing System - Final Plan
**Date:** December 26, 2025
**Status:** APPROVED
---
## 1. Pricing Foundation
### 1.1 Credit Pricing
| Item | User Pays |
|------|-----------|
| **1 Credit** | **$0.10** |
| 1 Basic Image | 1 credit ($0.10) |
| 1 Premium Image | 4 credits ($0.40) |
*Everything is credits. Images consume credits.*
### 1.2 Our Costs
| Item | Our Cost | User Pays | Margin |
|------|----------|-----------|--------|
| 1 Credit (AI tokens) | $0.01 | $0.10 | 90% |
| 1 Basic Image | $0.02 | $0.10 | 80% |
| 1 Premium Image | $0.08 | $0.40 | 80% |
---
## 2. Plan Structure
### 2.1 Credits per Plan
| Plan | Total Credits | Image Allocation | AI Credits | Plan Price |
|------|---------------|------------------|------------|------------|
| **Starter** | 1,000 | 200 basic (or 50 premium) | 800 | **$100** |
| **Growth** | 2,000 | 800 basic (or 200 premium) | 1,200 | **$200** |
| **Scale** | 5,000 | 2,000 basic (or 500 premium) | 3,000 | **$500** |
*Price = Total Credits × $0.10*
### 2.2 Other Plan Limits (from screenshot)
| Plan | Price | Sites | Users | Keywords | Articles* |
|------|-------|-------|-------|----------|-----------|
| **Starter** | $100 | 2 | 2 | 500 | ~50 |
| **Growth** | $200 | 5 | 3 | 2,000 | ~200 |
| **Scale** | $500 | 99 | 5 | 5,000 | ~500 |
*Approximate based on credit allocation
---
## 3. Credit Cost per Operation
| Operation | Credits | Notes |
|-----------|---------|-------|
| Clustering | 5 | Per cluster batch |
| Idea Generation | 10 | Per idea |
| Content Writing (Short ~800w) | 20 | Minimum |
| Content Writing (Medium ~1500w) | 30 | Average |
| Content Writing (Long ~2500w) | 40 | Long-form |
| Image Prompt Extraction | 10 | Per article |
| Basic Image | 1 | Per image |
| Premium Image | 4 | Per image |
| Linking | 3 | Per article |
| Optimization | 5 | Per article |
---
## 4. Use Case Scenarios (Full Plan Consumption)
### 4.1 Starter Plan (1000 credits)
| Scenario | Clustering | Ideas | Content | Img Prompts | Images | Link/Opt | Total | Fits? |
|----------|------------|-------|---------|-------------|--------|----------|-------|-------|
| **Heavy Images** | 5×5=25 | 10×10=100 | 10×25=250 | 10×10=100 | 200×1=200 | 10×8=80 | **755** | ✅ |
| **Premium Images** | 5×5=25 | 10×10=100 | 10×25=250 | 10×10=100 | 50×4=200 | 10×8=80 | **755** | ✅ |
| **Content Heavy** | 10×5=50 | 30×10=300 | 20×30=600 | 0 | 0 | 0 | **950** | ✅ |
| **Balanced** | 5×5=25 | 15×10=150 | 15×25=375 | 15×10=150 | 100×1=100 | 15×8=120 | **920** | ✅ |
| **Long Articles** | 3×5=15 | 8×10=80 | 8×40=320 | 8×10=80 | 150×1=150 | 8×8=64 | **709** | ✅ |
**Starter delivers: 8-20 articles depending on usage pattern**
### 4.2 Growth Plan (2000 credits)
| Scenario | Clustering | Ideas | Content | Img Prompts | Images | Link/Opt | Total | Fits? |
|----------|------------|-------|---------|-------------|--------|----------|-------|-------|
| **Heavy Images** | 10×5=50 | 25×10=250 | 25×25=625 | 25×10=250 | 500×1=500 | 25×8=200 | **1875** | ✅ |
| **Premium Focus** | 10×5=50 | 30×10=300 | 30×25=750 | 30×10=300 | 100×4=400 | 30×8=240 | **2040** | ⚠️ |
| **Content Heavy** | 15×5=75 | 50×10=500 | 40×30=1200 | 0 | 0 | 0 | **1775** | ✅ |
| **Balanced** | 10×5=50 | 40×10=400 | 35×25=875 | 35×10=350 | 250×1=250 | 0 | **1925** | ✅ |
| **Agency Mix** | 15×5=75 | 60×10=600 | 30×30=900 | 30×10=300 | 100×1=100 | 0 | **1975** | ✅ |
**Growth delivers: 25-50 articles depending on usage pattern**
### 4.3 Scale Plan (5000 credits)
| Scenario | Clustering | Ideas | Content | Img Prompts | Images | Link/Opt | Total | Fits? |
|----------|------------|-------|---------|-------------|--------|----------|-------|-------|
| **Heavy Images** | 20×5=100 | 80×10=800 | 80×25=2000 | 80×10=800 | 800×1=800 | 80×8=640 | **5140** | ⚠️ |
| **Premium Focus** | 25×5=125 | 100×10=1000 | 100×25=2500 | 100×10=1000 | 100×4=400 | 0 | **5025** | ⚠️ |
| **Content Heavy** | 30×5=150 | 150×10=1500 | 100×30=3000 | 0 | 0 | 0 | **4650** | ✅ |
| **Balanced** | 25×5=125 | 100×10=1000 | 80×30=2400 | 80×10=800 | 400×1=400 | 0 | **4725** | ✅ |
| **Full Pipeline** | 20×5=100 | 80×10=800 | 70×30=2100 | 70×10=700 | 600×1=600 | 70×8=560 | **4860** | ✅ |
**Scale delivers: 70-150 articles depending on usage pattern**
---
## 5. Cost vs Pricing Analysis
### 5.1 Our Cost per Plan (Worst Case - Max Images)
| Plan | AI Credits Cost | Image Cost | Total Our Cost | Plan Price | Margin |
|------|-----------------|------------|----------------|------------|--------|
| **Starter** | 800 × $0.01 = $8 | 200 × $0.02 = $4 | **$12** | $100 | **88%** |
| **Growth** | 1200 × $0.01 = $12 | 800 × $0.02 = $16 | **$28** | $200 | **86%** |
| **Scale** | 3000 × $0.01 = $30 | 2000 × $0.02 = $40 | **$70** | $500 | **86%** |
### 5.2 Our Cost per Plan (Premium Images)
| Plan | AI Credits Cost | Image Cost | Total Our Cost | Plan Price | Margin |
|------|-----------------|------------|----------------|------------|--------|
| **Starter** | 800 × $0.01 = $8 | 50 × $0.08 = $4 | **$12** | $100 | **88%** |
| **Growth** | 1200 × $0.01 = $12 | 200 × $0.08 = $16 | **$28** | $200 | **86%** |
| **Scale** | 3000 × $0.01 = $30 | 500 × $0.08 = $40 | **$70** | $500 | **86%** |
### 5.3 Cost per Article
| Plan | Plan Price | ~Articles | Price/Article |
|------|------------|-----------|---------------|
| **Starter** | $100 | 15 | **$6.67** |
| **Growth** | $200 | 40 | **$5.00** |
| **Scale** | $500 | 100 | **$5.00** |
---
## 6. Final Plan Summary
| Plan | Price | Credits | Image Allocation | Sites | Users | Keywords |
|------|-------|---------|------------------|-------|-------|----------|
| **Starter** | **$100/mo** | 1,000 | 200 basic / 50 premium | 2 | 2 | 500 |
| **Growth** | **$200/mo** | 2,000 | 800 basic / 200 premium | 5 | 3 | 2,000 |
| **Scale** | **$500/mo** | 5,000 | 2,000 basic / 500 premium | 99 | 5 | 5,000 |
### What User Gets
| Metric | Starter | Growth | Scale |
|--------|---------|--------|-------|
| **~Articles/month** | 15 | 40 | 100 |
| **~Images/month** | 200 | 800 | 2,000 |
| **Our Margin** | 88% | 86% | 86% |
---
## 7. Simplified System
### 7.1 Remove All Monthly Limits
**Keep only:**
- ✅ Credits (single pool)
- ✅ Keywords (storage limit)
- ✅ Sites, Users (account limits)
**Remove:**
- ❌ max_content_ideas
- ❌ max_content_words
- ❌ max_images_basic / max_images_premium
- ❌ max_image_prompts
- ❌ All usage tracking fields
### 7.2 How Images Work
Images just consume credits from the same pool:
- Basic image = 1 credit
- Premium image = 4 credits
User decides how to spend their credits (AI or images).

View File

@@ -75,7 +75,12 @@ class CreditUsageLog(AccountBaseModel):
('idea_generation', 'Content Ideas Generation'),
('content_generation', 'Content Generation'),
('image_generation', 'Image Generation'),
('image_prompt_extraction', 'Image Prompt Extraction'),
('linking', 'Internal Linking'),
('optimization', 'Content Optimization'),
('reparse', 'Content Reparse'),
('site_page_generation', 'Site Page Generation'),
('site_structure_generation', 'Site Structure Generation'),
('ideas', 'Content Ideas Generation'), # Legacy
('content', 'Content Generation'), # Legacy
('images', 'Image Generation'), # Legacy

View File

@@ -566,6 +566,7 @@ class CreditCostConfigAdmin(SimpleHistoryAdmin, Igny8ModelAdmin):
list_filter = ['is_active', 'updated_at']
search_fields = ['operation_type', 'display_name', 'description']
actions = ['bulk_activate', 'bulk_deactivate']
fieldsets = (
('Operation', {
@@ -626,6 +627,18 @@ class CreditCostConfigAdmin(SimpleHistoryAdmin, Igny8ModelAdmin):
obj.updated_by = request.user
super().save_model(request, obj, form, change)
@admin.action(description='Activate selected configurations')
def bulk_activate(self, request, queryset):
"""Bulk activate credit cost configurations"""
updated = queryset.update(is_active=True)
self.message_user(request, f'{updated} configuration(s) activated.', messages.SUCCESS)
@admin.action(description='Deactivate selected configurations')
def bulk_deactivate(self, request, queryset):
"""Bulk deactivate credit cost configurations"""
updated = queryset.update(is_active=False)
self.message_user(request, f'{updated} configuration(s) deactivated.', messages.WARNING)
class PlanLimitUsageResource(resources.ModelResource):
"""Resource class for exporting Plan Limit Usage"""

View File

@@ -0,0 +1,28 @@
# Generated by Django 5.2.9 on 2025-12-26 01:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('billing', '0020_create_ai_model_config'),
]
operations = [
migrations.AlterField(
model_name='creditcostconfig',
name='operation_type',
field=models.CharField(choices=[('clustering', 'Keyword Clustering'), ('idea_generation', 'Content Ideas Generation'), ('content_generation', 'Content Generation'), ('image_generation', 'Image Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('linking', 'Internal Linking'), ('optimization', 'Content Optimization'), ('reparse', 'Content Reparse'), ('site_page_generation', 'Site Page Generation'), ('site_structure_generation', 'Site Structure Generation'), ('ideas', 'Content Ideas Generation'), ('content', 'Content Generation'), ('images', 'Image Generation')], help_text='AI operation type', max_length=50, unique=True),
),
migrations.AlterField(
model_name='creditusagelog',
name='operation_type',
field=models.CharField(choices=[('clustering', 'Keyword Clustering'), ('idea_generation', 'Content Ideas Generation'), ('content_generation', 'Content Generation'), ('image_generation', 'Image Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('linking', 'Internal Linking'), ('optimization', 'Content Optimization'), ('reparse', 'Content Reparse'), ('site_page_generation', 'Site Page Generation'), ('site_structure_generation', 'Site Structure Generation'), ('ideas', 'Content Ideas Generation'), ('content', 'Content Generation'), ('images', 'Image Generation')], db_index=True, max_length=50),
),
migrations.AlterField(
model_name='historicalcreditcostconfig',
name='operation_type',
field=models.CharField(choices=[('clustering', 'Keyword Clustering'), ('idea_generation', 'Content Ideas Generation'), ('content_generation', 'Content Generation'), ('image_generation', 'Image Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('linking', 'Internal Linking'), ('optimization', 'Content Optimization'), ('reparse', 'Content Reparse'), ('site_page_generation', 'Site Page Generation'), ('site_structure_generation', 'Site Structure Generation'), ('ideas', 'Content Ideas Generation'), ('content', 'Content Generation'), ('images', 'Image Generation')], db_index=True, help_text='AI operation type', max_length=50),
),
]

View File

@@ -0,0 +1,18 @@
# Generated manually
# Fix historical table to allow NULL in calculation_mode column
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('billing', '0021_alter_creditcostconfig_operation_type_and_more'),
]
operations = [
migrations.RunSQL(
sql='ALTER TABLE billing_historicalcreditcostconfig ALTER COLUMN calculation_mode DROP NOT NULL;',
reverse_sql='ALTER TABLE billing_historicalcreditcostconfig ALTER COLUMN calculation_mode SET NOT NULL;',
),
]