Frequently asked questions
What is the API endpoint?
Send a POST request to https://api.pj88.info/v1/audio/speech. The JSON body mirrors the OpenAI speech endpoint, allowing you to use official OpenAI SDKs by changing the base_url to https://api.pj88.info/v1 and providing your API key.
Do I need to install a specific SDK?
No. You can use any HTTP client or the official OpenAI SDKs by updating the base_url. There is no proprietary MediSpeak SDK, mobile SDK, or WordPress plugin. Standard HTTP libraries work perfectly for integrating the TTS service into your workflows.
How do I handle errors?
The API returns standard HTTP error codes. Failed synthesis requests are free, and the charge is returned in full if the request fails. Check the response status to determine if the audio generation succeeded or if an error occurred.
Can I use this in a mobile app?
Yes. Since the API is accessed via standard HTTP requests, it works in any mobile app environment that can make network calls. There is no dedicated mobile SDK, so you will integrate using standard HTTP libraries or OpenAI SDKs.
Is the audio format compatible with all players?
You can choose from mp3, wav, opus, flac, or pcm. MP3 and WAV offer broad compatibility with most media players and devices. Select the format that best fits your patient education delivery platform's requirements.
How do I know if the request succeeded?
A successful request returns the audio file in the response body along with a 200 status code. If the request fails, you receive an error response. Failed requests do not incur charges, ensuring you only pay for successful synthesis.
Can I cache the audio files?
Yes. The API returns the audio file in the response but does not store it. You are responsible for caching the generated audio files locally or on your server to avoid redundant requests and reduce costs for repeated content.
What if the text has special characters?
The API handles standard text input. Spaces and punctuation count as characters toward your limit. Ensure your input does not exceed 4096 characters per request. For longer texts, split them into parts and join the resulting audio files.
How do I test with a small amount of text?
Sign in with Google to receive a free trial with $0.50 credit, sufficient for about 50,000 characters. Use the provided curl example on the /get-api-key/ page to send a short test request and verify the audio output.
Is there a sandbox environment?
No. There is only one production environment; there is no separate sandbox. Use your free trial credit to test the API. Failed requests are free, allowing you to test error handling without incurring charges during your development and integration phase.
Can I use the same key for multiple projects?
Yes. Each account has one active API key that can be used across multiple projects or services. You can issue a new key at any time, which immediately invalidates the old one, allowing you to rotate keys if needed.
How do I upgrade my key?
You can issue a new API key at any time from your account dashboard. The new key becomes active immediately, and the old key stops working at once. This allows you to rotate keys for security or project separation.
What is the difference between tts-1 and tts-1-hd?
Both models use the same engine and have the same price. The only difference is the model identifier in the request. You can choose either 'tts-1' or 'tts-1-hd' without any change in cost or performance characteristics.
Do I need to worry about latency?
Requests are processed sequentially, so under load, a request may wait in a queue. Typical speed is roughly real-time, but short phrases take a few seconds. Plan your integration to handle potential delays during peak usage periods.
Can I use this for emergency alerts?
Yes, but there is no SLA or uptime guarantee. Requests are processed one after another, so latency may increase under load. For critical emergency alerts, consider your tolerance for potential delays and queueing during high-volume periods.
How do I report a bug?
Support is available by email only. There is no live chat or phone support. Send your bug report, including request details and reproduction steps, to the support email address provided on the contact page for assistance.
Is the API available globally?
Yes. The API is a cloud service accessible from anywhere with an internet connection. There are no data-center choices or regional restrictions. You can integrate it into your healthcare applications regardless of your users' geographic location.
Do I need a custom domain?
No. You interact with the API via https://api.pj88.info/v1. Your application can reside on any domain. The API key authenticates your requests, so your application's domain does not need to match the API endpoint.
Why API Integration Matters
API integration transforms static patient education materials into dynamic, context-aware audio experiences. By generating audio on demand, medical product teams can deliver precise, up-to-date instructions without managing complex media servers or licensing deals for static files.
This approach ensures that dosage changes, appointment times, or new guidelines are immediately reflected in the audio output, reducing the risk of patients listening to outdated information and improving compliance with current care protocols.
Dynamic content generation
Dynamic generation supports personalized care. Systems can inject patient-specific details, such as dosage instructions or appointment times, directly into the generated audio file.
Instead of maintaining a library of thousands of static MP3s, your application sends text to the API and receives the audio file. This reduces storage overhead and ensures that the audio content always matches the latest clinical guidelines or patient-specific data.
- Inject variables like name, dosage, or date directly into the text payload.
- Generate unique audio for each patient record without pre-rendering.
- Update clinical content instantly across all users without redistributing files.
Multilingual support
Medicine is global, and patient comprehension varies by language. The API supports 23 languages, including Spanish, Chinese, Arabic, and Hindi, allowing you to serve diverse patient populations with a single integration. Each voice can speak any supported language, ensuring consistent quality across all locales.
You can explicitly set the language field to avoid ambiguity, especially for Latin-script texts that might otherwise default to English. This guarantees that a Spanish-speaking patient receives clear, accurate instructions in their native tongue.
- Support 23 languages with a single API key.
- Explicit language codes prevent default English fallback for non-English Latin text.
- Consistent voice quality across all supported languages.
Scalable delivery
Patient education needs can spike during health campaigns or new drug launches. The API handles concurrent requests with predictable character-based pricing, scaling from a few dozen to thousands of requests per minute. Rate limits are set at 60 requests per minute per key, with a lower threshold for new accounts.
For long patient guides, the API processes texts up to 4096 characters per request. Your application can split longer texts into parts and join the resulting audio files, ensuring seamless playback without manual audio editing or complex stitching logic.
- Scale from startup volume to enterprise loads seamlessly.
- Predictable pricing: $0.01 per 1,000 characters, no minimum spend.
- Handle long texts by splitting into 4096-character chunks and joining audio.
Step 1: Get Your API Key
To start using MediSpeak for patient education materials, you need an active API key. This key authenticates your requests to the speech endpoint and tracks your usage against your account balance.
Account creation is fast and requires no enterprise onboarding. You can choose the method that fits your team's workflow, whether that is using existing credentials or setting up a dedicated service account.
Sign up on the site
Navigate to the /get-api-key/ page on pj88.info. This is the central dashboard where you will manage your credentials, view your current balance, and monitor character consumption. The interface provides a clear overview of your account status without unnecessary complexity.
- No minimum spend or monthly plans required
- Accounts are independent per site
- Immediate access to usage metrics
Google or email login
You can sign in using your Google account for quick setup, or create a standard account with an email and password. Google sign-ins automatically receive a $0.50 trial credit valid for 7 days. Email-based accounts start without trial credit but are fully functional for production use.
Choose the method that best suits your security policies. Both methods provide a single active key per account, ensuring clear attribution for all API calls made to the TTS endpoint.
- Google login includes $0.50 trial credit
- Email/password accounts start with zero balance
- One active key per account
Copy the key
Once logged in, your API key is displayed on the dashboard. Copy this key, which starts with 'tts-', and store it securely. You will use this string in the Authorization header of your HTTP requests.
You can generate a new key at any time. When a new key is issued, the old one stops working immediately, allowing you to rotate credentials without downtime if needed.
- Key format: 'tts-...'
- Old key invalidates instantly on new issuance
- Use in Authorization: Bearer header
Step 2: Configure the Request
To generate audio, send a POST request to https://api.pj88.info/v1/audio/speech. The JSON body requires the model ("tts-1" or "tts-1-hd"), the input text (max 4096 characters), and a voice preset. Include response_format (mp3, wav, opus, flac, pcm) and optional speed (0.25–4.0).
JSON body structure
Ensure your payload includes all required fields. The input field accepts plain text strings. Spaces and punctuation count toward the 4096-character limit. Failed requests incur no charge, but successful synthesis consumes character credits from your balance.
Voice selection
Choose from eight licensed presets based on your clinical context. Female voices include aria (narrator), nova (upbeat), luna (storytelling), and sage (instructional). Male options cover felix (promo), milo (conversational), atlas (news), and orion (documentary).
- Aria: Warm, clear narrator
- Sage: Calm, instructional tone
- Atlas: Neutral, news-style delivery
- Orion: Deep, documentary voice
Language setting
Specify the language parameter using an ISO code (e.g., "en", "es", "de") to ensure accurate pronunciation. If omitted, the system guesses the language, defaulting to English for Latin script. Explicitly setting the language is critical for non-English patient guides to avoid mispronunciation of medical terms.
Step 3: Handle the Response
Upon successful synthesis, the API returns the audio file directly in the HTTP response body. The format matches your request specification, supporting MP3, WAV, Opus, FLAC, or PCM. No intermediate storage is required; the binary data is delivered immediately for playback or direct attachment to patient education materials.
Receive audio file
The response contains the raw audio bytes. Ensure your client handles binary data correctly without interpreting it as JSON. For streaming use cases, you must implement your own logic to split long texts into 4096-character chunks and join the resulting audio files, as the API does not support streaming.
Error handling
Failed synthesis requests incur no charge and return a full refund. If the input text exceeds 4096 characters or contains invalid parameters, the API returns an error code. Check the status code and response body to identify if the issue is a rate limit (429) or a validation error.
- Invalid input: Verify character count and voice presets.
- Rate limit: Implement exponential backoff on 429 responses.
- Service unavailable: Retry after a short delay.
Storage considerations
Generated audio is not stored by the API; it is returned in the response and discarded. You are responsible for storing the audio files if needed for future patient access. Request metadata (time, characters, status) is retained solely for billing purposes.
- No server-side storage of generated audio.
- Client-side storage recommended for patient guides.
- Metadata retained for billing only.
Step 4: Optimize for Patient Guides
Patient education materials often exceed the 4,096-character limit per request. To ensure reliable synthesis, split your content into smaller segments and concatenate the resulting audio files. This approach prevents truncation and maintains continuity for complex medical explanations.
Split long texts
Divide your guide into chunks of up to 4,096 characters. Each request generates a separate audio file; your application must join these files sequentially to recreate the full narrative. This ensures no data is lost during transmission.
- Maximum 4,096 characters per request
- Join audio files client-side
- Handles complex medical terminology effectively
Adjust speed
Adjustable speed (0.25–4.0) helps match the audio to patient needs without altering cost. Faster speeds do not reduce character counts; you pay per character of input text, not duration. Use lower speeds for elderly patients or those with cognitive impairments to improve comprehension.
- Range: 0.25 to 4.0
- Cost based on input text length
- Improves accessibility for diverse audiences
Choose appropriate voices
Select voices that enhance clarity and trust. For instructional guides, use Sage (calm, instructional) or Atlas (neutral, news). For engaging patient stories, Luna (soft, storytelling) works well. Ensure the voice aligns with the tone of the medical condition being explained.
- Sage for instructions
- Atlas for neutral news
- Luna for storytelling
Step 5: Test with Curl
Testing via command line provides immediate validation of your API credentials and voice synthesis capabilities before embedding the integration into your patient education application. Using curl ensures you can verify audio generation without writing full application code.
This method isolates connectivity and authentication issues, allowing your engineering team to confirm that the MediSpeak endpoint returns valid audio files with the expected properties.
Copy the example
Begin by retrieving the standard curl command provided on your dashboard’s /get-api-key/ page. This template contains the correct POST structure for the /v1/audio/speech endpoint, including default parameters for model, voice, and format.
The example uses aria as the default voice and mp3 as the format, which is suitable for most patient education materials.
- Base URL: https://api.pj88.info/v1
- Method: POST
- Content-Type: application/json
Replace your key
Update the Authorization header value with your specific API key. Ensure you copy the key exactly as displayed, including the tts- prefix.
You can also modify the input field with a short test phrase, such as 'Please take this medication twice daily,' to verify natural speech synthesis.
Verify output
Execute the command in your terminal. A successful response returns the audio file directly to your console or saves it to a file if redirected.
Check that the file plays correctly and that the voice matches your selected preset. If you receive a 429 error, you may have exceeded the 60 requests per minute limit.

Step 6: Use OpenAI SDK
Using the official OpenAI SDK simplifies integration by allowing you to route requests through a familiar interface by changing the base_url. This approach is ideal for teams already using Python or Node.js libraries for other services, reducing the need to maintain custom HTTP client logic for text-to-speech generation.
Install the library
Add the standard OpenAI SDK package to your project dependencies. This provides the client classes needed to construct and send requests to our API endpoint without writing raw HTTP code.
Set base URL
Configure the client’s base URL to point to https://api.pj88.info/v1. This redirects all SDK calls to our infrastructure while maintaining the standard request shape, ensuring compatibility with existing code structures.
Call the speech endpoint
Invoke the audio.speech.create method with your API key, selected voice, and input text. The SDK handles serialization and returns the audio file directly, streamlining the workflow for generating patient education audio.
Ensure you handle the response correctly to save the audio file or stream it to the patient’s device. The SDK manages the connection, allowing you to focus on the content logic, but you must handle the response correctly to save the audio file or stream it to the patient’s device.
Step 7: Manage Rate Limits
Rate limits are enforced per API key to ensure stability during high-volume patient education delivery. You are allowed 60 requests per minute once your account is active, with a lower threshold of 10 requests per minute before your first top-up. Monitoring your usage helps prevent service interruptions during critical workflow periods.
When limits are exceeded, the API returns a 429 status code. Implementing exponential backoff in your integration ensures your application waits appropriately before retrying, maintaining data integrity without overwhelming the server during peak demand.
Monitor usage
Track your request volume through the dashboard or API response headers. Understanding your current tier (60 rpm post-top-up vs. 10 rpm pre-top-up) allows you to plan batch processing for large patient guide libraries effectively.
- Check dashboard for real-time usage stats
- Verify key tier status in settings
Handle 429 errors
Implement logic to catch HTTP 429 responses. Do not retry immediately; use a delay strategy that increases with each consecutive error to avoid thundering herd issues. Failed requests during this window do not consume credits.
- Log 429 events for debugging
- Use exponential backoff strategies
Queue requests
For large-scale patient education materials, queue your requests rather than sending them all simultaneously. This ensures steady processing and respects the 60 requests per minute limit, ensuring consistent audio generation speeds.
- Use a message queue service
- Process in controlled batches
Step 8: Billing and Credits
MediSpeak charges $0.01 per 1,000 characters, including spaces and punctuation. Failed synthesis requests are free, ensuring you only pay for successful audio generation. This predictable, character-based model simplifies budgeting for large patient education libraries without hidden fees or monthly subscriptions.
Track character usage
Input text is counted exactly as sent. Each request supports up to 4,096 characters. For longer patient guides, split the text into chunks and join the resulting audio files. The API dashboard displays real-time usage, allowing your team to monitor consumption accurately.
- Cost: $10 per 1 million characters
- Failed requests are free
- Spatial characters count toward the limit
Top up with USDT
Payments are processed via USDT on the TRON network (TRC-20). The minimum top-up is $5, and credits are applied automatically within minutes of the transfer. No credit cards, PayPal, or VAT invoices are required, streamlining procurement for healthcare IT departments.
Balances do not expire. You can maintain a consistent reserve for ongoing content generation needs without worrying about subscription renewals.
- Network: TRON (TRC-20)
- Minimum top-up: $5
- Auto-credit within minutes
Monitor balance
Your account dashboard provides a clear view of your remaining balance and character count. This transparency helps product teams forecast costs for new educational modules. You can also issue a new API key at any time, instantly invalidating the old one for security.
- ['Real-time balance updates', 'Instant key rotation', 'No monthly billing cycles']
Step 9: Data Privacy
Our API treats input text strictly as a transient payload. Text is processed solely to generate the audio response and is not retained in the final audio file, which is delivered directly in the HTTP response. This ensures that sensitive patient education content does not linger in your storage after delivery.
Input data handling
Input text is used exclusively for synthesis. Once the audio is generated and returned, the raw text is not stored. This minimizes exposure risks for patient education materials, ensuring your content remains ephemeral during the generation process.
No training usage
Unlike many consumer-grade services, we do not use your input text to train our models. Your patient guide content remains yours, with no risk of your specific wording or medical explanations appearing in other users' outputs due to model updates.
Metadata retention
We retain request metadata, including timestamp, character count, and status, strictly for billing and usage verification. This data is necessary to calculate your character-based charges and ensure accurate billing but does not include the actual content of your patient guides.
Step 10: Troubleshooting
Integration issues usually stem from request structure or rate limits. Ensure your JSON body matches the required schema and that your API key is correctly formatted in the Authorization header.
Common errors
A 401 error indicates an invalid or expired API key. Re-generate your key via the dashboard if authentication fails. Ensure you are using the correct base URL for your region.
- 401: Invalid or missing API key
- 429: Rate limit exceeded (60 req/min)
- 400: Malformed JSON body
Voice not working
Verify that the voice ID exists in the /v1/voices endpoint. Ensure the selected voice supports the specified language parameter. If the voice is unsupported, switch to a compatible preset from the eight available options.
Language mismatch
If Latin script text defaults to English, explicitly set the language parameter (e.g., 'de' for German). Missing language codes for non-English Latin texts may result in incorrect pronunciation.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. Medical product teams need predictable budgets for patient education materials.
23 languages
Any voice speaks any of these languages.
