Understanding AI credits

credit_balance (owner_id, balance) + credit_transaction (owner_id, amount, type) + team_credit_cap (member_user_id, monthly_cap). Cap exceeded → 402. Charging gated by creative_billing flag.

Written By Salvatore Sinigaglia

Last updated About 5 hours ago

credit_balance (owner_id, balance) + credit_transaction (owner_id, amount, type) + team_credit_cap (member_user_id, monthly_cap). Cap exceeded → 402. Charging gated by creative_billing flag.

Understanding AI credits

AI generation can be metered by credits deducted from your team's credit_balance, but charging is gated by the creative_billing flag. Three tables back it: credit_balance (per owner: balance, plus weekly-grant and monthly-cap fields), credit_transaction (debit / credit ledger), and team_credit_cap (per-member monthly caps). View balance + transactions at /settings/team/billing. Top up via Stripe (see acc-* billing cluster).

The creative_billing flag ships OFF by default, so unless it's enabled for your workspace, standalone generations run without any credit hold or debit. When it's ON, generations are metered and charged as described below. To confirm whether metering is active for your workspace, check /settings/team/billing — a live balance and transaction ledger means charging is on.

Who is this for

Anyone wondering "what does this cost?" + admins managing team budget for AI generation.

How credits work

When the creative_billing flag is ON, a generation deducts cost from the team's credit balance:

  1. You submit a generation (POST /api/v1/creative-hub/generate/{type})
  2. With the flag ON, credits are held before the job is enqueued; if the balance is insufficient or a cap is exceeded, the request returns 402
  3. Worker performs the generation — pays the upstream provider (Flux, Runway, HeyGen, ElevenLabs, etc.)
  4. On completion the held credits are settled; a credit_transaction entry is written and credit_balance decrements

With the flag OFF (the default), the request runs exactly as today with no charge — no hold, no debit. Failed generations do not charge either.

The three tables

credit_balance

One row per owner. Key fields:

  • owner_id
  • balance (current purchased credits, Int) + total_purchased / total_used
  • monthly_cap / monthly_used / cap_reset_at
  • Weekly grant pool: weekly_cap / weekly_used / week_reset_at, plus grant_balance (use-it-or-lose-it weekly grant that is drained before purchased balance)
  • Auto-recharge fields (auto_recharge_enabled, threshold, target, etc.)

Read by /settings/team/billing for the headline number.

credit_transaction

Append-only ledger. Key fields:

  • id, owner_id, user_id
  • amount (positive = credit, negative = debit) + balance_after
  • type (transaction type) + description
  • stripe_payment_intent_id (for top-ups), chat_message_id (for chat-linked spend)
  • created_at

Use case: audit "where did our credits go?" — sort debits by amount.

team_credit_cap

Optional per-member cap to prevent runaway spend. Fields:

  • team_id, member_user_id
  • monthly_cap / monthly_used
  • reset_at
  • enforced (boolean)

When usage reaches the cap (and the creative_billing flag is ON), generation requests for that member return 402 (the error message can be e.g. "Weekly credit cap exceeded" / "Insufficient credits"). Admin must raise the cap or wait for the reset.

Cost varies by provider + type + duration + resolution

Wevion doesn't publish fixed per-generation credit prices because:

  • Provider pricing changes (Flux, Runway, HeyGen update prices independently)
  • Cost depends on parameters (1024×1024 image cheaper than 2048×2048; 5s video cheaper than 10s)
  • Workspace plan may include credit bundles + overage rates

For the current cost of a specific generation: see the cost estimate in the generation form before submitting OR check cost_cents in the resulting creative_job row.

Where to view + manage credits

/settings/team/billing shows:

  • Current balance in credits / dollars
  • Monthly usage broken down by generation type
  • Recent transactions (paginated; filter by date / type)
  • Team caps (if set) with current usage vs cap
  • Top up button (opens Stripe checkout for credit purchase)

Top up via Stripe

For Stripe-enabled workspaces:

  1. /settings/team/billingTop up
  2. Pick amount or custom value
  3. Stripe checkout opens
  4. Confirm payment
  5. credit_transaction credit entry written via Stripe webhook
  6. credit_balance increments

For Enterprise customers: credit bundles often included in plan; overage billed separately. See acc-108 pricing tiers.

Team credit caps (admin)

Owners / super_admin can set per-member caps to prevent one member from burning team budget:

  1. /settings/team/billingMember caps
  2. Per-member input: monthly cap in credits / dollars
  3. Save → enforced going forward

Existing usage in current month preserved. Cap applies to month-to-date usage only.

To remove a cap: clear the value + save.

Credits in generation flow

Before submitting a generation, the form may show an estimated cost based on your parameters. Final cost recorded after generation completes (small variance possible due to upstream provider pricing).

After completion:

  • Generation card shows actual cost_cents charged
  • Linked to the credit_transaction entry
  • Subtracted from credit_balance

Failed jobs are free

If a generation fails (provider error, content moderation rejection, network):

  • creative_job.status = failed
  • cost_cents remains 0
  • No settled credit_transaction debit (any pre-enqueue hold is released when the flag is ON)
  • No charge to balance

(With the creative_billing flag OFF, nothing is charged in the first place.)

Compliance + audit

credit_transaction is append-only, with balance_after recorded on every row. Top-ups link to stripe_payment_intent_id; chat-linked spend links to chat_message_id.

For audits: export transactions from /settings/team/billing → review largest debits (by amount) → identify cost drivers (specific providers, specific users).

Best practices

Set team caps before runaway

Don't wait until a member burns the budget. Set conservative caps + raise as needed.

Top up in bundles

Stripe bundles often offer volume discounts. Top up in larger chunks (with budget approval).

Review monthly usage

Quarterly trend on /settings/team/billing tells you whether AI generation is paying off (campaign performance vs cost).

Prefer cheaper providers for iteration

Iterating on prompts: use cheaper providers (openai_tts over elevenlabs, baseline image providers over high-end). Switch to premium when concept locked.

Common mistakes

  • Surprised by bill: didn't set team caps, member generated freely. Cap is the fix.
  • Topping up small amounts repeatedly: less efficient than bundle top-ups. Plan ahead.
  • Ignoring failed jobs: they cost nothing — but their existence may indicate content issues (prompt rejections); review patterns.
  • Mixing personal + team credits: Wevion's credits are team-scoped, not user. Member usage debits team balance.

Steps

  1. You submit a generation (POST /api/v1/creative-hub/generate/{type})
  2. With the flag ON, credits are held before the job is enqueued; if the balance is insufficient or a cap is exceeded, the request returns 402
  3. Worker performs the generation — pays the upstream provider (Flux, Runway, HeyGen, ElevenLabs, etc.)
  4. On completion the held credits are settled; a credittransaction entry is written and creditbalance decrements

Last updated: 2026-05-17