Skip to main content

CLI: Billing & Subscription

Manage your Trix subscription, credits, usage, and billing with the CLI.

Overview

The billing command provides comprehensive tools for managing your Trix subscription, viewing usage statistics, monitoring credit consumption, and accessing billing information. Trix uses a metered billing system with included credits and pay-as-you-go overage.

How Billing Works

Credits are consumed by:

  • LLM inference (chat, completions)
  • Embeddings generation
  • Memory storage
  • Search operations
  • Compute jobs (enrichment, transcription)

Subscription Status

View your current subscription details and credit balance at a glance.

# View subscription and credits
trix billing status

# Output as JSON
trix billing status -o json

Example output:

Subscription Status:
──────────────────────────────────────────────────
Plan:    Pro
Status:  Active
Period:  Jan 01, 2024 to Feb 01, 2024
         25 days remaining

Credits:
──────────────────────────────────────────────────
Available: 8,500 / 10,000 (15.0% used)
Purchased: 2,000

Available Plans

View all available subscription plans with pricing and features.

# Show available plans
trix billing plans

Plans are displayed with:

  • Monthly and yearly pricing
  • Included credits per month
  • Rate limits (API, search, bulk operations)
  • Plan descriptions and features

Credit Management

Monitor your credit balance with visual progress bars and detailed breakdowns.

# Full credit display with progress bar
trix billing credits

# Compact single-line display
trix billing credits --compact

# Hide action breakdown
trix billing credits --no-breakdown

The credits command shows:

  • Visual progress bar indicating usage level
  • Color-coded warnings (green/yellow/red)
  • Breakdown by action type (embeddings, storage, search, etc.)
  • Days remaining in the billing period

Credit Costs

View how many credits each action costs:

# Show all credit costs
trix billing costs

# Filter by action type
trix billing costs --action llm_inference
trix billing costs --action embedding
trix billing costs --action storage

# Filter by provider
trix billing costs --provider anthropic
trix billing costs --provider openai

# Show summary view
trix billing costs --summary

Usage Statistics

View detailed usage breakdown for your current billing period.

# Show current period usage
trix billing usage

# Show usage history (last N periods)
trix billing usage --history 6
trix billing usage --history 12

Usage statistics include:

  • Memories created
  • Embeddings generated
  • Searches performed
  • API calls made
  • Audio minutes transcribed
  • Credits used and remaining
  • Breakdown by action type

Credit Transactions

View detailed credit transaction history showing credits added, used, and refunded.

# View recent transactions
trix billing transactions

# Show more transactions
trix billing transactions --limit 50

# Pagination
trix billing transactions --limit 50 --offset 50

# Filter by type
trix billing transactions --type credit
trix billing transactions --type debit

# Filter by action
trix billing transactions --action embedding
trix billing transactions --action llm_inference

Upgrade Subscription

Upgrade to a higher plan with more features and credits. The CLI opens a checkout page in your browser.

# Upgrade to Pro plan (monthly)
trix billing upgrade --plan pro

# Upgrade to Max plan (yearly)
trix billing upgrade --plan max --period yearly

# Apply discount code
trix billing upgrade --plan pro --discount CODE123

The upgrade command opens a checkout page in your browser. Your subscription will be updated immediately upon successful payment.

Downgrade Subscription

Schedule a downgrade to a lower tier plan. The downgrade takes effect at the end of your current billing period, so you'll continue to have access to your current plan's features until then.

# Downgrade to Pro plan
trix billing downgrade --plan pro

# Downgrade to Free plan
trix billing downgrade --plan free

# Skip confirmation
trix billing downgrade --plan pro --force

# Check pending downgrade status
trix billing downgrade --status

# Cancel a scheduled downgrade
trix billing downgrade --cancel

When you downgrade, you may lose access to certain features including reduced credit allocation, lower rate limits, and fewer spaces and memories.

Cancel & Resume

Cancel your subscription or resume a cancelled subscription.

Cancel Subscription

# Cancel at period end (recommended)
trix billing cancel

# Provide cancellation reason
trix billing cancel --reason "switching to competitor"

# Cancel immediately (loses access now)
trix billing cancel --immediately

Resume Subscription

# Resume a cancelled subscription
trix billing resume

You can resume a subscription that was scheduled for cancellation before it ends. After your subscription has ended, you'll need to use trix billing upgrade instead.

Pause & Unpause

Temporarily pause your subscription when you need a break from the service.

Pause Subscription

# Pause subscription
trix billing pause

# Pause with reason
trix billing pause --reason "Taking a break"

When you pause your subscription:

  • Your data is retained and safe
  • API access is suspended
  • Billing stops until you unpause
  • Different from cancellation (which ends at period end)

Unpause Subscription

# Resume paused subscription
trix billing unpause

Spending Limit

Set a spending limit to cap the maximum credits that can be consumed in a billing period. When the limit is reached, additional credit-consuming operations will be blocked.

# View current spending limit
trix billing spending-limit

# Set spending limit
trix billing spending-limit --set 1000
trix billing spending-limit --set 5000

# Disable spending limit
trix billing spending-limit --disable

A spending limit helps prevent unexpected overage charges. Set it to your monthly credit budget to ensure predictable costs.

Purchase Additional Credits

Buy additional credits to increase your available balance beyond what's included with your plan. Credits are one-time purchases and do not expire.

# List available credit packages
trix billing buy-credits --list

# Purchase specific amount
trix billing buy-credits --amount 1000

# Purchase a package
trix billing buy-credits --package starter

Credit packages often include volume discounts for larger purchases.

Notification Preferences

Manage how and when you receive billing-related notifications.

# View current notification preferences
trix billing notifications

# Enable/disable email alerts
trix billing notifications --email-alerts=true
trix billing notifications --email-alerts=false

# Set credit usage threshold (alert at X% used)
trix billing notifications --threshold 80
trix billing notifications --threshold 90

# Disable threshold alerts
trix billing notifications --threshold 0

# Disable all notifications
trix billing notifications --disable

Notification types:

  • Email alerts for billing events
  • Credit usage threshold warnings
  • Weekly usage digest emails
  • Invoice and payment alerts

Invoices

List and download invoices for your subscription.

# List all invoices
trix billing invoices

# Show last 5 invoices
trix billing invoices --limit 5

# Filter by status
trix billing invoices --status paid
trix billing invoices --status pending

# View specific invoice
trix billing invoices inv_abc123

# Download invoice PDF
trix billing invoices inv_abc123 --download

# Output as JSON
trix billing invoices -o json

Billing Portal

Open the billing portal in your browser to manage payment methods and view detailed billing history.

# Open billing portal
trix billing portal

The billing portal allows you to:

  • Update payment methods
  • View and download invoices
  • Update billing information
  • Manage subscription details

Billing Audit Log

View the billing audit log for compliance and debugging. The audit log tracks all billing operations including subscription changes, credit purchases, and spending limit changes.

# View recent audit log
trix billing audit

# Filter by action type
trix billing audit --action subscription_cancel
trix billing audit --action credit_purchase
trix billing audit --action spending_limit_change

# Show more entries
trix billing audit --limit 100

# Pagination
trix billing audit --limit 50 --offset 50

Grace Period

Check if your account is in a grace period. A grace period is granted when there are billing issues, allowing continued access while the issue is being resolved.

# Check grace period status
trix billing grace-period

Common reasons for grace periods:

  • payment_failed: A payment attempt failed (update payment method)
  • subscription_expired: Your subscription has expired (renew subscription)
  • trial_ended: Your trial period has ended (upgrade to paid plan)
  • downgrade_pending: A plan downgrade is being processed

Command Reference

billing Commands

CommandDescription
statusShow subscription status and credit balance
plansList available subscription plans
creditsShow credit usage with progress bar
costsShow credit costs per action
usageShow usage for current period
transactionsShow credit transaction history
upgradeUpgrade subscription plan
downgradeSchedule subscription downgrade
cancelCancel subscription
resumeResume cancelled subscription
pausePause subscription temporarily
unpauseResume paused subscription
portalOpen billing portal in browser
invoicesList or view invoices
spending-limitView or set spending limit
buy-creditsPurchase additional credits
notificationsManage notification preferences
auditView billing audit log
grace-periodShow grace period status

Common Examples

Monitor Usage

# Quick status check
trix billing status

# Detailed credit breakdown
trix billing credits

# Usage trends over time
trix billing usage --history 6

# Recent transactions
trix billing transactions --limit 20

Set Budget Controls

# Set spending limit
trix billing spending-limit --set 5000

# Set up alerts
trix billing notifications --threshold 80

# Monitor credit usage
trix billing credits --compact

Upgrade Flow

# View available plans
trix billing plans

# Check current status
trix billing status

# Upgrade to Pro
trix billing upgrade --plan pro

# Verify new plan
trix billing status

Export Billing Data

# Export usage data
trix billing usage -o json > usage-$(date +%Y%m).json

# Export transactions
trix billing transactions --limit 1000 -o json > transactions.json

# Export audit log
trix billing audit --limit 500 -o json > audit.json

Next Steps