Nuxa
Execution

Cost Calculation & Credits

Nuxa tracks usage in credits for transparency across all services (LLM, embeddings, search, voice, and tools). Costs are recorded in dollars in the backend and surfaced as credits in the UI (1 credit = $0.01).

Billing data flows: service execution → /api/billing/update-cost → database columns → subscription UI. Credits are calculated from the shared pricing map in packages/db/credit-mappings.ts.

Plan Limits & Credits

PlanIncluded CreditsIncluded Value
Free1,000$10.00
Starter4,900$49.00
Growth14,900$149.00
Business39,900$399.00
EnterpriseCustomCustom

Usage below the included credits is covered by your plan. Usage above the included amount is charged as overage at the same rates.

What Gets Tracked

All services send cost events to /api/billing/update-cost with a serviceType and cost (in dollars). The subscription UI shows a breakdown per service whenever the amount is non-zero.

Core AI & Data

  • Hosted LLM (Bedrock): From $1.20 to $25.00 per 1M tokens depending on tier.
  • Embeddings: $0.156 per 1M tokens.
  • Document Processing: $0.02 per page.
  • Storage: $0.03/GB (S3), $0.12/GB (vector).

Voice & Search

  • Sonic Realtime Voice: $0.24 per minute.
  • Text-to-Speech: $0.36 per 1M characters.
  • Speech-to-Text: ~$0.0072 per minute.
  • Search: $0.002/query (Serper), $0.01/query (Exa).

Tools & Automation

  • Browserbase: $0.07 per session.
  • E2B Sandbox: $0.02 per execution.
  • Twilio: $0.01 per message (typical SMS baseline).

BYOK model usage is billed directly by your provider. Nuxa charges only for platform services (embeddings, storage, search, voice, tools). Hosted/managed LLM usage follows the Bedrock rates above.

How Costs Are Calculated

Costs are computed per operation using the shared pricing map. Examples:

// Credits conversion
1 credit = $0.01

// Embeddings
cost = (tokens / 1_000_000) * $0.156

// Sonic Realtime voice
cost = minutes * $0.24

// Search (Serper)
cost = queries * $0.002

Credits shown in the UI are derived from these dollar amounts (credits = dollars * 100).

Monitoring Usage

Find real-time usage under Settings → Subscription:

  • Current period credits used vs included credits
  • Per-service breakdown (LLM, embeddings, search, voice, Browserbase, E2B, Twilio)
  • Days remaining in the billing period
  • Organization totals (for team plans)

Execution logs also display model token usage and per-call costs for LLM blocks.

Overage Calculation

included = planCredits // e.g., 4_900 credits on Starter
overageCredits = Math.max(0, usedCredits - included)
overageDollars = overageCredits / 100

Overage uses the same per-service rates—there is no separate multiplier.

Implementation Pointers

  • Pricing source of truth: packages/db/credit-mappings.ts
  • Dollar ↔ credit helpers: apps/nuxa/lib/billing/credits/credits-converter.ts
  • Billing endpoint: apps/nuxa/app/api/billing/update-cost/route.ts
  • UI breakdown: Subscription settings modal (cost cards rendered only when > 0)

Cost Management Tips

  1. Prefer BYOK for heavy LLM usage; Nuxa will only meter platform services.
  2. Cache embeddings and reuse search results when possible.
  3. Monitor Sonic/voice minutes—voice rates are higher than search/storage.
  4. Batch tool executions (Browserbase/E2B) to reduce per-call overhead.
  5. Watch the per-service breakdown; optimize the categories with the highest spend first.

Next Steps

  • Review current usage in Settings → Subscription.
  • Align workflows with the per-service rates above to forecast spend.
  • If you need managed LLM billing, confirm pricing for your Bedrock tier before launch.