Account Balance
Check your text-to-speech usage balance, remaining credits, and estimated overage charges.
Overview
The balance endpoint provides real-time information about your text-to-speech usage, including:
- Total included characters in your plan
- Characters used this month
- Remaining characters
- Overage usage and estimated charges
Monitor your balance regularly to avoid unexpected charges and ensure you stay within your plan limits.
Using the SDK
The Node.js SDK provides a simple way to check your balance:
The SDK handles authentication and error handling automatically. It’s the recommended way to interact with the Suonora API if you’re using Node.js.
REST API
You can check your balance using the REST API directly. Here are examples in different languages:
Indicates if the request was successful
Contains the balance information
Example Response
For Python, Java, or other languages, you can use the REST API directly with your preferred HTTP client library.
Best Practices
-
Monitor Usage
- Check balance regularly to track usage
- Set up alerts when approaching limits
- Monitor for unusual usage patterns
-
Handle Overage
- Implement usage limits in your application
- Notify users before they exceed their plan
- Consider upgrading plans for consistent overage
-
Error Handling
- Always check the
success
flag - Handle API errors gracefully
- Implement retry logic for temporary failures
- Always check the
For production applications, consider implementing automated balance checks and notifications to help users manage their usage effectively.