Skip to main content
1

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.
2

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.
3

REST API

You can check your balance using the REST API directly. Here are examples in different languages:
boolean
required
Indicates if the request was successful
object
required
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

  1. Monitor Usage
    • Check balance regularly to track usage
    • Set up alerts when approaching limits
    • Monitor for unusual usage patterns
  2. Handle Overage
    • Implement usage limits in your application
    • Notify users before they exceed their plan
    • Consider upgrading plans for consistent overage
  3. Error Handling
    • Always check the success flag
    • Handle API errors gracefully
    • Implement retry logic for temporary failures
For production applications, consider implementing automated balance checks and notifications to help users manage their usage effectively.