Billing

Credits

Understand how credits work, how to purchase them, and how to manage your credit balance.

How Credits Work

Engrami credits are the currency used to pay for all platform operations. Credits provide a simple, predictable way to manage costs across all features.

  • Conversion Rate: 1 USD = 100 credits
  • Welcome Bonus: New accounts receive 5,000 free credits
  • No Expiration: Credits never expire
  • Transferable: Credits can be shared across workspaces (Enterprise)

Purchasing Credits

Via Dashboard

  1. Navigate to Billing in the sidebar
  2. Click Add Credits
  3. Select a credit package or enter custom amount
  4. Complete checkout via Stripe

Via API

# Create checkout session
curl -X POST https://api.engrami.com/api/v1/billing/checkout \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "package_id": "growth",
    "success_url": "https://your-app.com/billing?success=true",
    "cancel_url": "https://your-app.com/billing?canceled=true"
  }'

# Response
{
  "session_id": "cs_live_abc123...",
  "checkout_url": "https://checkout.stripe.com/pay/cs_live_abc123"
}

Auto-Recharge

Set up automatic credit purchases when balance falls below a threshold:

curl -X POST https://api.engrami.com/api/v1/billing/auto-recharge \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": true,
    "threshold": 1000,
    "recharge_amount": 10000,
    "payment_method_id": "pm_abc123"
  }'

Checking Balance

Via Dashboard

Your current balance is displayed in the top navigation bar and on the Billing page.

Via API

curl https://api.engrami.com/api/v1/billing/balance \
  -H "Authorization: Bearer YOUR_TOKEN"

# Response
{
  "balance": 45230,
  "pending_charges": 120,
  "available": 45110,
  "currency": "credits",
  "last_updated": "2024-01-20T10:30:00Z"
}

Transaction History

View all credit transactions including purchases, usage, and adjustments:

curl https://api.engrami.com/api/v1/billing/transactions?limit=10 \
  -H "Authorization: Bearer YOUR_TOKEN"

# Response
{
  "items": [
    {
      "id": "txn_abc123",
      "type": "purchase",
      "amount": 50000,
      "description": "Growth Package Purchase",
      "balance_after": 52340,
      "created_at": "2024-01-20T10:30:00Z"
    },
    {
      "id": "txn_def456",
      "type": "usage",
      "amount": -245,
      "description": "Agent chat: customer-support",
      "balance_after": 2340,
      "created_at": "2024-01-20T09:15:00Z",
      "metadata": {
        "agent_id": "agent_xyz",
        "tokens_used": 2450
      }
    },
    {
      "id": "txn_ghi789",
      "type": "welcome_bonus",
      "amount": 5000,
      "description": "Welcome credits for new account",
      "balance_after": 5000,
      "created_at": "2024-01-15T08:00:00Z"
    }
  ],
  "total": 156
}

Low Balance Alerts

Configure notifications when your balance is running low:

curl -X POST https://api.engrami.com/api/v1/billing/alerts \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "alerts": [
      {
        "threshold": 5000,
        "channels": ["email", "slack"]
      },
      {
        "threshold": 1000,
        "channels": ["email", "slack", "sms"]
      }
    ]
  }'

Spending Limits

Set limits to control costs:

curl -X POST https://api.engrami.com/api/v1/billing/limits \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "monthly_limit": 100000,
    "daily_limit": 5000,
    "per_agent_limit": 10000,
    "action_on_limit": "pause"  // or "alert_only"
  }'

Refunds

Credit refunds are available under these conditions:

  • Within 30 days of purchase for unused credits
  • Service outages exceeding SLA commitments
  • Billing errors or duplicate charges

To request a refund, contact support@engrami.com with your transaction ID.

Continue to Usage Tracking