Skip to main content

Overview

The usage tracking system monitors creator activity against tier limits and enforces subscription boundaries server-side.

GET /api/usage

Retrieve usage statistics for authenticated user.

Authentication

Requires Directus JWT token.

Response

string
Current pricing tier: starter, creator, pro, or studio
object
Tier limits for all tracked operations
object
Current usage counts for billing period
object
Remaining capacity (limit - usage) for each operation

Example

cURL

POST /api/usage/increment

Increment usage counter for a specific operation.

Authentication

Requires Directus JWT token or shared secret.

Request Body

string
required
Operation name (e.g., posts_ai_assisted, taxonomy_ai_calls)
number
Increment amount (default: 1)

Response

boolean
Whether increment succeeded
number
Updated usage count
boolean
Whether user has hit tier limit

Example

cURL

Tracked Operations

Operation Keys

Limit Value Convention

  • Positive number: Hard limit enforced
  • -1: Unlimited (no enforcement)
  • 0: Feature disabled for tier

Usage Reset Schedule

Monthly counters reset on the 1st of each month at 00:00 UTC:
  • posts_ai_assisted
  • posts_published
  • taxonomy_ai_calls
  • watermark_ops
  • ai_clip_ops
  • thumbnail_ops
Concurrent counters track current state (no reset):
  • scheduled_queue_size
  • platforms_connected
  • team_seats

Enforcement Points

Usage limits enforced at:
  1. API endpoints: /api/captions, /api/queue, /api/genie/stream-chat
  2. Media worker: Job creation in media-worker/index.js
  3. Dashboard UI: Proactive warnings before limit reached
  4. Post scheduler: Queue size check before adding posts

Upgrade Prompts

When user hits limit:
Dashboard shows upgrade banner with next tier benefits.

Implementation

Source: server/endpoints/api/usage.js Usage data stored in user_personas collection:
  • Fields: {operation}_used and {operation}_limit
  • Server-side validation on every increment
  • Atomic updates to prevent race conditions
Usage tracking is essential for monetization. All AI/media operations must call /api/usage/increment before execution.

Pricing Tiers

Detailed tier limits and pricing structure

User Profile

View and update user tier assignment