Frequently asked questions
What is the first step in API integration?
Sign up on /get-api-key/ with Google or email to receive your API key. Then, send a POST request to https://api.xsmbthu7.info/v1/audio/speech with your key in the Authorization header. Set the model to tts-1 or tts-1-hd and provide your Hindi text in the input field to receive the audio file.
How do I handle Hindi text encoding?
Send your Hindi text as standard UTF-8 JSON in the input field. The API automatically detects the language from the script, so you do not need to manually set the language parameter. If you prefer explicit control, you can set the language field to 'hi'.
Can I use the API with WordPress LMS?
Yes, but there is no official WordPress plugin. You must build a custom integration using the OpenAI SDK or plain HTTP requests. Configure your plugin to send text to the API endpoint and store the returned audio file, then link it to your course content.
How do I store the generated audio files?
The API returns the audio file directly in the response body. It is not stored on our servers. You must save the file to your own storage, such as your LMS media library or a cloud bucket, immediately after receiving the response to ensure availability for students.
What is the best way to handle rate limits?
The limit is 60 requests per minute per key. Implement a simple queue or delay mechanism in your integration to ensure you do not exceed 60 requests per minute. This prevents request failures and ensures smooth audio generation during bulk processing of course materials.
How do I debug API errors?
Check the HTTP status code and response body for error details. Failed requests are free, so no charge is applied if synthesis fails. Ensure your Authorization header includes the correct Bearer token and that your input text does not exceed 4096 characters.
Can I use the API for live courses?
Yes, but requests are processed sequentially, so under load, a request may wait in a queue. For live use, pre-generate audio files for course content. This ensures consistent playback without waiting for real-time generation during student sessions.
How do I calculate costs for a course?
Cost is $0.01 per 1,000 characters, including spaces and punctuation. Count the total characters in your script. For example, a 10,000-character course module costs $0.10. Failed requests incur no charge, so only successful generations are billed.
What happens if the API is down?
There is no SLA or uptime guarantee. If the API is unavailable, requests will fail. Failed requests are free. You should implement error handling in your integration to retry or notify users when the service is temporarily unavailable.
Do I need a backend server?
Yes, a backend is recommended to securely store your API key and manage requests. Direct client-side calls expose your key. The backend can handle rate limiting, caching, and queuing requests to ensure efficient processing of Hindi text to audio.
Can I cache the audio files?
Yes, since the API does not store generated audio, you should cache files on your own infrastructure. Cache based on the text, voice, speed, and format. This reduces API calls, lowers costs, and improves playback speed for returning students.
How do I update voice selections?
Change the voice parameter in your API request body. You can choose from eight presets like aria, nova, or felix. To see available voices, send a GET request to /v1/voices. Update your LMS settings to reflect the new voice choice.
Is the API suitable for mobile apps?
Yes, you can use the official OpenAI SDKs by changing the base URL. However, there is no dedicated mobile SDK. Ensure your app handles API keys securely and manages caching to optimize bandwidth and reduce costs for mobile users.
How do I handle character limits in long texts?
Split text into parts of up to 4096 characters. Generate audio for each part separately, then join the audio files in your backend or player. This ensures compliance with the API limit while delivering complete course content to users.
What is the average generation time?
Generation is roughly real time, about 25 characters per second. Short phrases take a few seconds. Requests are processed sequentially, so under load, a request may wait in a queue. Plan your integration accordingly to avoid user wait times.
Can I mix multiple voices in one audio?
No, each request generates audio with a single voice preset. To mix voices, generate separate audio files for each voice and join them in your audio processing tool or LMS player. The API does not support multi-voice tracks in a single request.
How do I test the API before going live?
Use the free trial credit of $0.50 upon signing in with Google. Send test requests to the endpoint with sample Hindi text. Verify the audio format and voice quality. Check the /get-api-key/ page to monitor usage and ensure your integration works correctly.
Prerequisites for Integration
To integrate the CourseCast API into your LMS, you first need a valid API key. This key authenticates your requests to the speech endpoint and tracks your usage against your account balance.
API Key Acquisition
Sign up for an account on the /get-api-key/ page using Google or an email address. Your unique API key appears immediately, ready to be copied into your LMS configuration.
- One active key per account
- New keys invalidate old ones instantly
- $0.50 free trial for Google sign-ins
Developer Account Setup
Navigate to the dashboard to view your balance, character usage, and a ready-to-use cURL example. This interface helps you monitor your $0.01 per 1,000 characters cost structure.
LMS Plugin Requirements
Ensure your LMS supports custom API calls or allows plugin development. You will need to configure the base URL and inject the Bearer token into request headers.
- HTTPS support required
- JSON payload capability
- Custom header injection
Configuring the API Endpoint
To configure the CourseCast API, modify your LMS plugin's base URL from the default OpenAI endpoint to https://api.xsmbthu7.info/v1. This single change allows you to use standard OpenAI SDKs while routing requests through our infrastructure. Ensure your code points to this specific host for all TTS operations.
Authentication relies on a Bearer token. Include the header Authorization: Bearer tts-... with every request. Your unique API key is available on the /get-api-key/ dashboard. Without this header, the API rejects the request, so verify the string matches your active key exactly.
Base URL Modification
Update your integration's base URL to https://api.xsmbthu7.info/v1. This ensures all SDK calls route correctly to the CourseCast engine. No code rewrite is needed if using standard OpenAI-compatible libraries; only the endpoint host changes.
Header Authentication
Include Authorization: Bearer tts-... in every HTTP request. Use the key issued from your account dashboard. Ensure no extra spaces or quotes surround the token, as this causes immediate rejection.
JSON Payload Structure
Send a POST request to /v1/audio/speech with a JSON body. Required fields include model ("tts-1" or "tts-1-hd"), input (your Hindi text), and voice (e.g., "aria"). Optional fields like speed and response_format allow further customization of the output audio.
- Model: "tts-1" or "tts-1-hd"
- Input: Text string (max 4096 chars)
- Voice: e.g., "aria", "nova"
- Response Format: mp3, wav, opus, flac, or pcm
Handling Hindi Text Input
Sending Hindi text to the TTS API requires careful attention to character limits and language detection. The API counts every character, including spaces and punctuation, against a 4,000-character limit per request. For longer course content, you must split the text into chunks and concatenate the resulting audio files later.
Accurate language specification ensures the synthetic voice renders Devanagari script correctly. Without explicit instruction, the system may guess English for Latin-script text, but Hindi requires explicit tagging to avoid mispronunciation.
Character Counting
Each request supports up to 4,000 characters. Since spaces count, a 4,000-character limit may contain fewer actual words. Monitor your input length before sending to avoid truncation or silent failures.
Longer educational modules should be programmatically split into 4,000-character segments. The API returns separate audio files for each chunk, which your LMS must stitch together sequentially for playback.
- Count all characters, including spaces and punctuation.
- Split text into 4,000-character chunks for long courses.
- Concatenate audio files in order for final playback.
Language Code Specification
Always set the language field to hi for Hindi text. While the API can guess scripts, explicit specification prevents errors, especially when mixing languages or using mixed scripts.
This ensures the selected voice applies the correct phonetic rules for Hindi, maintaining natural rhythm and clarity for students listening to course material.
- Set
language: "hi"for Hindi input. - Explicit codes prevent mispronunciation errors.
- Useful for mixed-language course content.
Text Preprocessing
Remove special characters or emojis that might confuse the synthesis engine. Standardize whitespace to ensure accurate character counting and clean audio output.
Ensure your preprocessing script handles Unicode normalization correctly, as Hindi text can have multiple valid representations for the same character.
- Strip non-essential special characters.
- Normalize Unicode for consistent rendering.
- Validate character counts before API calls.
Processing Audio Responses
Once the API returns the audio file, your system must handle the binary response efficiently. The response body contains the raw audio data, which your LMS plugin should capture directly without intermediate file saves unless required for debugging. Ensure your HTTP client is configured to stream or buffer the binary payload correctly to prevent memory issues during large generation tasks.
Binary Data Handling
Directly pipe the response stream into your audio player or storage buffer. Avoid parsing the binary data as JSON; treat it as a raw byte array. This ensures minimal latency and prevents corruption of the audio file structure, which is critical for immediate playback in your LMS.
- Validate content-type before saving to disk
- Ensure binary integrity by checking file headers
File Format Selection
Choose the response_format parameter based on your LMS compatibility. MP3 offers a balance of quality and file size for web playback, while WAV provides uncompressed quality for local editing. OPUS is ideal for low-bandwidth mobile users, and FLAC offers lossless compression for archival purposes. Select PCM only if your system requires raw uncompressed data for further processing.
- MP3: Best for general web playback
- WAV: High quality, larger file size
- OPUS: Efficient for low-bandwidth environments
- FLAC: Lossless compression for archival
- PCM: Raw data for further processing
Storage on LMS
Store the generated audio files in your LMS media library, associating them with the specific course module or lesson. Since generated audio is not stored by the API, you must manage your own storage lifecycle. Delete temporary files after successful playback or after a defined retention period to optimize storage costs. Ensure the file names are unique to avoid conflicts when multiple users request the same text.
- Associate audio with specific course modules
- Implement a retention policy for temporary files
- Use unique file names to prevent conflicts
Managing Rate Limits
The API enforces a strict limit of 60 requests per minute per key. New accounts without top-ups start with a lower tier of 10 requests per minute. Understanding these boundaries prevents wasted credits during high-traffic course generation periods.
Monitoring Request Counts
Track your usage via the dashboard to stay within the 60 requests/minute threshold. Since requests are processed sequentially, under load your requests may queue, extending generation time. Monitoring ensures you do not exceed limits unnecessarily.
- Check usage metrics on the /get-api-key/ dashboard.
- Note the 10 req/min limit before first top-up.
Retry Logic Implementation
Implement exponential backoff in your LMS integration. If a request fails or hits a limit, wait briefly before retrying. This prevents overwhelming the server and ensures smooth audio synthesis for Hindi text and other languages.
- Wait and retry on 429 Too Many Requests.
- Increase wait time with each failed attempt.
Queue Management
Since audio is generated sequentially, long texts split into parts may experience delays. Manage your queue to avoid duplicate requests. Ensure your LMS handles partial audio files correctly before merging them for the final course asset.
Error Handling Strategies
Reliable error handling ensures your LMS audio generation remains stable under varying network conditions. Since requests are processed sequentially, failures can occur due to transient network issues or server-side timeouts. Properly catching these errors prevents your course narration workflows from breaking silently.
Network Timeout Handling
Set explicit timeout limits (e.g., 30 seconds) for API calls. If the server does not respond within this window, treat the request as failed rather than hanging indefinitely, which is critical for maintaining user experience in interactive LMS environments.
- Configure client-side timeout to 30 seconds.
- Treat non-responses as failed requests to trigger fallback logic.
Invalid Response Codes
Monitor HTTP status codes closely. A 4xx error typically indicates an issue with your request, such as an invalid API key or exceeding the character limit. A 5xx error suggests a temporary server problem. Only 429 errors relate to rate limits, which are handled separately.
- 4xx errors: Check key validity and input format.
- 5xx errors: Indicate server-side temporary issues.
Retry with Exponential Backoff
Implement exponential backoff for transient errors (5xx or timeouts). Start with a short delay (e.g., 1 second) and double the wait time for each subsequent retry, up to a maximum of three attempts. This prevents overwhelming the API during high load while ensuring eventual success.
- Retry up to 3 times.
- Double wait time: 1s, 2s, 4s.
Testing the Integration
Verify your integration works by sending a sample Hindi text to the API endpoint. This confirms that your LMS correctly formats the JSON payload and handles the authentication header without errors.
Sample Request Testing
Send a short Hindi phrase using the tts-1 model. Confirm you receive a valid audio file in the response body. Check that the character count matches your input exactly.
- Use a simple Hindi sentence for the test.
- Verify the HTTP 200 status code.
- Confirm the audio file downloads correctly.
Voice Selection Validation
Test different voices like Aria or Milo to ensure they render Hindi correctly. Verify that the language parameter is set to hi for accurate pronunciation.
- Check voice clarity in Hindi.
- Verify language code
hiworks. - Test speed adjustments.
Audio Quality Check
Ensure the audio file is not corrupted or silent. Verify the format matches your LMS requirements, such as MP3 or WAV.
- Check for audio corruption.
- Verify format compatibility.
- Ensure no background noise in audio.

Scaling for Multiple Courses
When managing multiple courses, batch processing simplifies the workflow by grouping text segments. Since the API processes requests sequentially, preparing chunks of up to 4,096 characters allows for efficient generation. This method ensures that each audio file corresponds precisely to a specific lesson segment without overlapping or data loss.
Parallel requests can accelerate generation if you run multiple independent keys or accounts, though each key is limited to 60 requests per minute. For most edtech teams, batching remains the most reliable approach to maintain order and prevent queue delays during high-volume course updates.
Batch Processing
Group text into 4,096-character segments to align with API limits. Generate audio files sequentially and join them for the final course module. This reduces the number of API calls and ensures consistent audio continuity across lesson parts.
- Split input text by semantic breaks, not just character count.
- Join resulting audio files using standard media tools.
- Maintain character count accuracy for billing purposes.
Parallel Requests
While the API queues requests, running parallel instances can speed up generation if you have multiple API keys. Each key allows 60 requests per minute. Use this to distribute load across different course tracks without exceeding individual rate limits.
- Use separate API keys for independent course batches.
- Monitor queue status to avoid excessive waits.
- Ensure keys do not exceed 60 requests per minute.
Cost Optimization
Since pricing is $0.01 per 1,000 characters, optimize text length by removing unnecessary pauses or redundant phrases. Use the free trial credit of $0.50 to test batch efficiency before committing to larger course sets. Failed requests are free, so retry logic does not incur extra costs.
- Pre-process text to remove redundant filler words.
- Test small batches with the $0.50 trial credit.
- Retry failed requests to avoid paying for errors.
Monitoring Usage and Costs
Tracking usage is essential for managing edtech budgets, as costs are calculated per character. The API provides transparent billing data, allowing teams to predict expenses for large course libraries accurately. Since failed requests are free, you only pay for successfully generated audio files, ensuring efficient spending.
Understanding your consumption patterns helps optimize content strategy. You can adjust voice selection or text length based on actual usage data without unexpected charges. This clarity supports sustainable scaling for growing LMS platforms.
Dashboard Analytics
The account dashboard displays real-time usage statistics, including total characters processed and request history. This data updates automatically after each API call, giving you immediate visibility into system activity.
You can view historical trends to identify peak usage times or specific courses driving higher volume. This insight helps in planning server resources and managing user expectations during high-demand periods.
- Real-time character count updates
- Request history with timestamps
- Status codes for each request
Character Tracking
Each request counts spaces and punctuation toward the 4,096-character limit. Precise tracking ensures you stay within bounds and avoid wasted characters on partial sentences.
Monitor character usage per voice model. Different voices may require similar character counts, but processing time varies. Tracking helps balance load and cost effectively.
- Count spaces and punctuation
- Track per-voice usage
- Monitor 4096-character limits
Budget Alerts
While the API does not offer built-in notification services, you can integrate external monitoring tools with your usage data. Set thresholds to alert your team when spending approaches your monthly limit.
Combine character tracking with your LMS’s budgeting tools. Regular audits of API keys and usage logs ensure no unauthorized or excessive usage occurs, maintaining financial control.
- Integrate with external tools
- Set spending thresholds
- Regular key audits
Security Best Practices
Protecting your API credentials and user data is essential for maintaining trust in your LMS environment. Proper security measures ensure that your text-to-speech integration remains robust and secure against common vulnerabilities.
Key Storage
Store your API key securely using environment variables rather than hardcoding it in your application’s source files. This prevents accidental exposure if your code is shared or pushed to public repositories. Rotate your key periodically via the dashboard to maintain security.
- Use environment variables for key storage
- Avoid hardcoding keys in source files
- Rotate keys regularly via the dashboard
HTTPS Enforcement
Ensure all communication between your LMS and the API endpoint uses HTTPS. This encrypts the data in transit, protecting your text inputs and generated audio files from interception. Always verify that your API base URL is prefixed with https://.
- Enforce HTTPS for all API calls
- Verify base URL uses https://
- Encrypt data in transit
Data Encryption
While the API does not store generated audio, ensure your LMS encrypts stored audio files at rest. This protects user content and ensures compliance with data privacy standards. Use standard encryption methods like AES-256 for stored media.
- Encrypt stored audio files at rest
- Use AES-256 for media storage
- Protect user content privacy
Common Integration Pitfalls
Integration failures often stem from input constraints or configuration mismatches. Since the API enforces a strict 4096-character limit per request, exceeding this value causes immediate synthesis failure without partial audio generation. Developers must implement pre-processing logic to split long Hindi texts into valid chunks before sending them to the endpoint.
Another common issue is ignoring the language parameter. While the API guesses language from script, Hindi text in Latin script (transliteration) may default to English pronunciation. Explicitly setting language: hi ensures correct phonetic rendering by voices like Nova or Aria, preventing awkward pronunciations in course materials.
Character Limit Errors
Each API call accepts a maximum of 4096 characters, including spaces and punctuation. If your course script exceeds this limit, the entire request fails. You must split the text into smaller segments, generate audio for each part, and concatenate the resulting audio files client-side or via a backend service.
Ensure your LMS plugin counts characters accurately before submission. Note that special Hindi diacritics may count as multiple bytes depending on your encoding, so always verify the character count matches the API’s definition, not just the visual length of the string.
- Split text at sentence boundaries to avoid cutting mid-word.
- Concatenate generated audio files sequentially for playback.
- Verify character count includes all spaces and punctuation.
Voice Mismatch Issues
Voices are preset and do not adapt to context. Selecting a voice like Felix (energetic) for a calm meditation module may create tonal inconsistency. Each voice has a fixed timbre; they cannot be fine-tuned for emotion or pitch. Test all eight voices with your specific Hindi content to find the best fit.
Remember that all voices support Hindi, but performance varies. Some voices may sound more natural with Hindi phonetics than others. Always validate audio output with native speakers before scaling to multiple courses.
- Test all 8 voices with sample Hindi text.
- Avoid mixing voices within a single course module.
- Validate pronunciation with native speakers before launch.
Audio Format Incompatibility
The API returns audio in formats like MP3, WAV, OPUS, FLAC, or PCM. Your LMS must support the chosen format. MP3 is widely compatible, but OPUS offers better compression. Ensure your LMS player can decode the selected format without transcoding, which adds latency.
Incorrect format selection can cause playback failures. For example, some older LMS platforms may not support OPUS. Stick to MP3 or WAV for maximum compatibility unless you have specific bandwidth constraints requiring OPUS or FLAC.
- Choose MP3 for broad LMS compatibility.
- Use OPUS for better compression if supported.
- Verify LMS player codec support before deployment.
Support and Resources
We provide direct support via email for integration questions. There is no phone number or live chat available. Our documentation covers all technical details you need to connect the API to your LMS.
For broader community insights, check our developer forums where users share code snippets and troubleshooting tips. This helps you resolve common issues quickly without waiting for a direct response.
Documentation Links
Our complete API reference is available at /docs/. It includes detailed guides for Hindi text handling, voice selection, and error codes. You can also find ready-to-use curl examples and SDK configurations for OpenAI-compatible libraries.
- API Reference: /docs/
- cURL Examples: Included in docs
- SDK Guides: OpenAI compatible
Community Forums
Join our developer community to discuss integration strategies and share solutions. Users often post specific LMS plugin configurations for Hindi content. This peer-to-peer support complements our direct email assistance.
Email Support Contact
For specific account or billing issues, email us at [email protected]. We respond to all inquiries promptly. Please include your API key prefix and a description of the issue for faster resolution.
Note that we do not offer SLA guarantees or priority support tiers. Our team handles all tickets equally via email.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. This pay-as-you-go structure allows edtech teams to scale audio generation up or down without committing to a fixed budget.
23 languages
Any voice speaks any of these languages.
