Billing Issues
This guide helps you resolve billing-related issues including insufficient credits, payment failures, and unexpected charges.
Insufficient Credits
Symptoms
{
"error": {
"code": "GATEWAY1_BILLING_001",
"message": "Insufficient credits. Your balance ($0.05) is below the minimum required ($0.10). Please add credits to continue.",
"type": "billing_error",
"status": 402
}
}Understanding Credit Requirements
LangMart requires a minimum credit balance to prevent overdraft:
| Setting | Default Value | Description |
|---|---|---|
| Minimum Balance | $0.10 | Balance required to make requests |
| Warning Threshold | $1.00 | Balance that triggers low balance alert |
Solutions
Check Your Balance
curl -X GET "https://api.langmart.ai/api/account/balance" \
-H "Authorization: Bearer YOUR_API_KEY"Response:
{
"balance": 0.05,
"currency": "USD",
"minimum_required": 0.10
}Add Credits
- Navigate to Billing in the dashboard
- Click Add Credits
- Select an amount or enter custom amount
- Complete the payment
Via API
curl -X POST "https://api.langmart.ai/api/billing/purchase" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"amount": 10.00}'Set Up Auto-Recharge
- Go to Billing > Settings
- Enable Auto-Recharge
- Set threshold (e.g., $5.00)
- Set recharge amount (e.g., $20.00)
Organization vs Personal Credits
Credits can be funded at two levels:
| Type | Description | Use Case |
|---|---|---|
| Personal | Individual user balance | Personal projects |
| Organization | Shared team balance | Team projects |
Check which funding source you're using:
- Navigate to Settings > Organization
- View your current funding source
- Switch if needed
Payment Failures
Common Payment Error Messages
| Error | Cause | Solution |
|---|---|---|
| Card declined | Insufficient funds | Use different card |
| Card expired | Card has expired | Update card details |
| Invalid card | Incorrect card number | Re-enter card details |
| Processing error | Temporary issue | Wait and retry |
| Authentication required | 3D Secure needed | Complete verification |
Solutions
Update Payment Method
- Go to Billing > Payment Methods
- Click Add Payment Method
- Enter new card details
- Set as default payment method
Verify Card Details
Ensure:
- Card number is correct (no spaces)
- Expiration date is valid
- CVV/CVC is correct
- Billing address matches card
Contact Your Bank
Some banks block international transactions or online purchases:
- Call your bank's customer service
- Inform them about the transaction
- Ask them to whitelist the merchant
Try Alternative Payment
LangMart supports multiple payment methods:
- Credit/Debit cards
- PayPal (if available)
- Bank transfer (for enterprise)
Unexpected Charges
Understanding Your Bill
View detailed billing breakdown:
curl -X GET "https://api.langmart.ai/api/billing/usage/breakdown" \
-H "Authorization: Bearer YOUR_API_KEY" \
-G \
-d "start_date=2025-01-01" \
-d "end_date=2025-01-31"Response:
{
"period": {
"start": "2025-01-01",
"end": "2025-01-31"
},
"total_cost": 47.85,
"breakdown": {
"by_model": [
{"model": "gpt-4o", "cost": 32.50, "requests": 850},
{"model": "claude-3-sonnet", "cost": 12.30, "requests": 420}
],
"by_day": [
{"date": "2025-01-15", "cost": 2.30},
{"date": "2025-01-16", "cost": 1.85}
]
}
}Common Causes of Unexpected Charges
1. High Token Usage
Long conversations accumulate tokens:
# Check token usage
curl -X GET "https://api.langmart.ai/api/account/analytics/usage" \
-H "Authorization: Bearer YOUR_API_KEY"Solution: Set max_tokens limits on requests:
{
"model": "gpt-4o",
"messages": [...],
"max_tokens": 1000
}2. Expensive Models
Some models cost significantly more:
| Model | Relative Cost |
|---|---|
| gpt-4o-mini | $ |
| gpt-4o | $ |
| claude-3-sonnet | $ |
| claude-3-opus | $$ |
| o1-preview | $$ |
Solution: Use cheaper models for simple tasks.
3. Failed Requests Still Charged
Some providers charge for tokens even if the request fails partway through.
Solution: Review error logs to identify and fix issues.
4. Runaway Scripts
Automated processes making excessive requests.
Solution:
- Implement rate limiting in your code
- Set up cost alerts
- Review request logs for patterns
Setting Spending Limits
Personal Spending Limit
curl -X PUT "https://api.langmart.ai/api/user/spending-limit" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"daily_limit": 10.00, "monthly_limit": 100.00}'Organization Spending Limit
curl -X PUT "https://api.langmart.ai/api/organizations/{org_id}/spending-limits" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"daily_limit": 100.00, "monthly_limit": 1000.00}'Setting Up Cost Alerts
- Navigate to Alerts in the dashboard
- Click Create Alert
- Select Cost Threshold
- Set threshold (e.g., $50/day)
- Choose notification method (email, dashboard)
Viewing Invoices
Access Invoices
curl -X GET "https://api.langmart.ai/api/billing/invoices" \
-H "Authorization: Bearer YOUR_API_KEY"Invoice Details
Each invoice includes:
- Invoice number
- Period covered
- Total amount
- Breakdown by model
- Payment status
Download Invoice PDF
- Go to Billing > Invoices
- Find the invoice
- Click Download PDF
Refund Requests
Eligibility
Refunds may be available for:
- Technical issues causing erroneous charges
- Duplicate charges
- Unauthorized usage (compromised API key)
Request Process
Gather Evidence:
- Request IDs for affected charges
- Error messages received
- Timestamps of issues
Submit Request:
- Go to Support > Billing Issue
- Select "Refund Request"
- Provide evidence and explanation
Review Time:
- Standard: 5 business days
- Complex cases: 10 business days
Preventing Unauthorized Charges
- Rotate API Keys: If you suspect key compromise
- Monitor Usage: Set up alerts for unusual activity
- IP Restrictions: Limit API access by IP (if supported)
- Review Access: Audit who has API key access
Credit Balance Questions
How Credits Work
- Pre-paid: Add credits before usage
- Deducted Per Request: Based on tokens used
- Real-time Updates: Balance updates after each request
Credit Expiration
| Credit Type | Expiration |
|---|---|
| Purchased | 1 year from purchase |
| Promotional | Varies (check terms) |
| Free trial | 30 days |
Check Credit History
curl -X GET "https://api.langmart.ai/api/account/credit-history" \
-H "Authorization: Bearer YOUR_API_KEY"Enterprise Billing
Custom Billing Arrangements
Enterprise customers may have:
- Monthly invoicing
- Net 30 payment terms
- Volume discounts
- Custom SLAs
Contact Support
For enterprise billing questions:
- Email: [email protected]
- Or contact your account manager
Still Having Issues?
If billing issues persist:
- Check Transaction History: Review all transactions in Billing section
- Verify Payment Method: Ensure card is valid and has funds
- Review Usage: Check for unexpected usage patterns
- Contact Support: Submit a billing support ticket
Related Documentation
- Usage Analytics - Track costs
- Connection Issues - Technical problems
- API Errors - Error reference