How to Integrate Portuguese Text-to-Speech API?

By Polyglot Dev editorial team · Updated 2026-11-19

This guide helps indie developers integrate high-quality Portuguese text-to-speech into their apps using our simple, OpenAI-compatible API. Whether you are building legal document readers or informational content tools, you will learn how to choose the right voice, set up your API key, and implement requests efficiently. We cover everything from basic cURL commands to handling errors and optimizing costs.

You will also discover how to manage Portuguese language detection, handle long documents by splitting text, and ensure your integration scales smoothly. With clear examples and specific numbers, this page removes the guesswork from adding multilingual audio to your project. Let’s get your Portuguese TTS feature live with clarity and affordability.

How to Integrate Portuguese Text-to-Speech API?

Frequently asked questions

What is the best way to integrate TTS?

Send a POST request to https://api.abc777.info/v1/audio/speech with your Bearer token. Use the OpenAI SDK by setting the base_url to our API endpoint. This ensures compatibility and easy integration for your multilingual text-to-speech needs.

Which SDK is recommended?

We recommend the official OpenAI SDKs. Configure them by changing the base_url to https://api.abc777.info/v1 and using your site’s key. This allows you to use standard methods while accessing our specific TTS endpoints.

How do I handle long texts?

Split your input text into parts of up to 4096 characters. Send each part as a separate request and join the resulting audio files. This ensures compliance with the single-request character limit while preserving your content.

What is the latency like?

Typical speed 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 before synthesis begins.

Can I cache audio files?

Yes, you can cache the returned audio files. Generated audio is not stored by our API, so caching locally or on your server reduces redundant API calls and costs. Input text is used only for production.

How do I detect Portuguese text?

The API guesses the language from the script. Latin script defaults to English. For Portuguese, you should explicitly set the language parameter to pt in your request to ensure correct voice synthesis and avoid misinterpretation.

What if the language is not detected?

If the language field is omitted, the API guesses based on the script. Latin text defaults to English. Always set the language parameter explicitly for non-English Latin-script text to ensure accurate Portuguese synthesis.

How do I split long texts?

Divide your text into chunks of up to 4096 characters. Send each chunk as a separate POST request to the speech endpoint. Then, concatenate the returned audio files to create a continuous audio stream for your users.

What are the rate limits?

You are limited to 60 requests per minute per key. Before your first top-up, this limit is 10 requests per minute. Exceeding this may result in delayed processing or errors depending on your current account status.

How do I retry failed requests?

Failed requests are free, so you can retry them without cost. Simply resend the POST request with the same parameters. The API will process the text again and return the audio file upon success.

Is streaming supported?

No, streaming is not supported. The API returns the complete audio file after synthesis is finished. You must wait for the full response before playing or caching the audio content in your application.

Can I use custom voices?

No, custom voice cloning is not offered. You can choose from eight preset voices like Aria, Nova, or Luna. These voices are based on licensed recordings and cannot be customized or cloned for your specific needs.

How do I manage API keys?

Manage keys via the /get-api-key/ page. You have one active key per account. You can issue a new key at any time, which immediately invalidates the old one. Secure your key in your application environment.

What is the support email?

Support is available by email only. There is no phone number or live chat. Send your inquiries to our support email address found on the contact page for assistance with your API integration or billing.

Are there examples for React?

Yes, use the OpenAI SDK in your React app. Set the base_url to https://api.abc777.info/v1. Pass your Portuguese text and voice selection to the speech endpoint. Standard HTTP requests also work directly within your fetch calls.

Are there examples for Node.js?

Yes, use the OpenAI SDK for Node.js. Configure the base_url to https://api.abc777.info/v1. Send your text and voice parameters to the speech endpoint. You can also use plain HTTP libraries like axios for direct integration.

How do I test the API?

Use the free trial credit of $0.50 given when signing in with Google. Make a POST request to the speech endpoint with a short Portuguese text. Check the response for the audio file or error details.

What is the trial period?

The free trial provides $0.50 of credit, valid for 7 days. This covers about 50,000 characters. Accounts created with email and password do not receive this trial credit automatically upon sign-up.

How do I top up with USDT?

Send USDT on the TRON network (TRC-20) to the address provided in your dashboard. The minimum top-up is $5. Credits are added automatically within minutes after the transfer is confirmed on the blockchain.

What is TRC-20?

TRC-20 is a token standard on the TRON blockchain. We accept USDT transfers using this standard for top-ups. Ensure you send funds from a compatible wallet to avoid delays or loss of your top-up amount.

Choosing the Right Voice

Sound wave illustration for: Choosing the Right Voice

Portuguese is fully supported across all eight voices, from Aria’s warm narration to Felix’s energetic promo style. The API does not distinguish between Brazilian and European Portuguese variants; any voice can speak any of the supported languages. You simply select your preferred voice and, if needed, specify the language code to ensure accurate pronunciation.

Brazilian vs European Portuguese

The engine handles both variants seamlessly. For legal documents or informational content, clarity is paramount. Use the language parameter to force Portuguese detection if the input text mixes Latin-script languages, ensuring the TTS engine doesn’t default to English.

  • All 8 voices support both dialects
  • Use language: "pt" for precision
  • No extra cost for variant selection

Voice Selection Criteria

Choose based on the tone of your legal or informational content. Aria offers a clear, warm narrator style suitable for reading contracts. Felix provides an energetic, promo-like tone for announcements. Milo is friendly and conversational, ideal for user guides. Select the voice that best matches the context of your text to enhance user comprehension.

  • Aria: clear, warm narrator
  • Felix: energetic, promo
  • Milo: friendly, conversational
  • Sage: calm, instructional

Tone Matching

Match the voice to the document’s purpose. Use Atlas for neutral, news-style legal updates or Orion for deep, documentary-style explanations. Avoid playful voices for serious legal terms. The goal is clarity and trust. Test different voices with sample text to ensure the tone aligns with your app’s brand identity.

  • Atlas: neutral, news
  • Orion: deep, documentary
  • Luna: soft, storytelling
  • Nova: bright, upbeat

Setting Up the API Key

Sound wave illustration for: Setting Up the API Key

Integration begins with authentication. Polyglot Dev provides a single active API key per account, issued upon verification. You can access your credentials via the /get-api-key/ dashboard, where your current key, balance, and usage statistics are displayed.

Google Login Setup

Sign up using your Google account to receive an immediate $0.50 trial credit (approx. 50,000 characters). This credit is valid for 7 days, allowing you to test Portuguese TTS integration without upfront payment.

  • Instant access to API key
  • $0.50 trial credit included
  • 7-day validity period

Email Login Setup

Create an account using your email and password. Unlike Google logins, email accounts do not include trial credit by default. You will need to top up using USDT on the TRON network (TRC-20) to begin making requests.

Key Security

Each account holds one active key. If you suspect a leak, issue a new key via the dashboard; the old key becomes invalid immediately. Always include the key in the Authorization: Bearer tts-... header.

  • One active key per account
  • Immediate revocation on key change
  • Standard Bearer token format

Implementing the Request

Sound wave illustration for: Implementing the Request

Integrating Polyglot Dev’s Portuguese TTS is straightforward because we use the same request shape as OpenAI. You send a POST request to the speech endpoint with your model, input text, and voice selection. This compatibility means you can use tools you already know, like cURL or the official OpenAI SDK, to get audio files in formats like mp3 or wav.

The key is configuring your authentication header correctly. Your API key starts with 'tts-'. Once configured, every request returns an audio file directly. You can also specify a language code like 'pt' to ensure Brazilian or European Portuguese is used, rather than relying on automatic detection.

Using cURL

cURL is the fastest way to test your integration. Send a POST request to https://api.abc777.info/v1/audio/speech with your JSON body. Include the Authorization header with your Bearer token. The API returns the audio file directly in the response body.

```bash curl -X POST https://api.abc777.info/v1/audio/speech \ -H "Authorization: Bearer tts-YourKeyHere" \ -H "Content-Type: application/json" \ -d '{"model": "tts-1", "input": "Olá, mundo!", "voice": "nova", "response_format": "mp3"}' \ -o output.mp3 ```

  • Use tts-1 or tts-1-hd for the model.
  • Set voice to one of the 8 presets like 'nova' or 'aria'.
  • Specify response_format as 'mp3', 'wav', 'opus', 'flac', or 'pcm'.

Using OpenAI SDK

Since our API is OpenAI-compatible, you can use the official OpenAI SDK by changing the base_url. Point the client to https://api.abc777.info/v1 and provide your API key. This allows you to use familiar methods like Audio.speech.create() without rewriting your logic.

This approach is ideal for Node.js or Python applications where you already have the SDK installed. It handles the HTTP connection and JSON parsing for you, returning the audio bytes directly.

```python import openai client = openai.OpenAI(base_url="https://api.abc777.info/v1", api_key="tts-YourKeyHere") speech_file = client.audio.speech.create( model="tts-1", voice="nova", input="Olá, mundo!", response_format="mp3" ) ```

  • Set base_url to https://api.abc777.info/v1.
  • Use tts-1 or tts-1-hd models.
  • Supports standard SDK parameters like speed and language.

Handling JSON Responses

The API returns the audio file directly in the response body, not as a JSON object with a URL. If successful, you receive binary data (mp3, wav, etc.) that you can save to a file or stream. There is no JSON wrapper to parse for the audio content itself.

If an error occurs, the response will contain a JSON object with an error field. This includes a code and a message describing the issue, such as invalid input or rate limits. Check the status code to determine if the request succeeded or failed.

Always handle potential network errors and rate limit responses (429) gracefully. Your application should retry or wait as needed before sending the next request to stay within the 60 requests per minute limit.

Handling Errors

Sound wave illustration for: Handling Errors

Robust error handling ensures your app remains responsive when the TTS API encounters issues. Whether it is a temporary network glitch, a rate limit hit, or a malformed request, handling these cases gracefully keeps your user experience smooth and predictable.

Network Errors

Network errors occur when the connection to https://api.abc777.info/v1 is interrupted. Implement exponential backoff to retry failed requests automatically. Check your internet connection and firewall settings to ensure stable access to the API endpoint.

  • Retry failed requests with exponential backoff
  • Check firewall settings for API access
  • Implement timeout handling for slow connections

Rate Limit Errors

You are limited to 60 requests per minute per key (10 before top-up). If you exceed this, you will receive a 429 error. Monitor your usage and implement a queue system to pace requests, ensuring you stay within limits.

  • Limit: 60 requests/minute per key
  • Initial limit: 10 requests/minute
  • Implement request queuing to avoid 429 errors

Invalid Input Errors

Ensure your input text is under 4096 characters and the voice ID is valid. If the language is not specified, the API guesses it, which may lead to incorrect pronunciation. Always validate input before sending it to the API.

  • Max input length: 4096 characters
  • Validate voice ID before sending
  • Specify language to avoid guessing errors

Optimizing Costs

Sound wave illustration for: Optimizing Costs

Cutting costs with our Portuguese TTS API is straightforward because pricing is flat: $0.01 per 1,000 characters, including spaces and punctuation. Since there are no monthly plans or hidden fees, your primary lever for optimization is managing input volume and request efficiency. Focus on reducing unnecessary characters and reusing generated audio where possible.

Understanding how character counting works helps you estimate costs accurately. Each request processes up to 4096 characters, so splitting long legal documents correctly avoids wasted API calls while keeping audio files clean.

Batch Processing

Instead of sending multiple small requests for separate sentences, split long texts into chunks of up to 4096 characters. The API processes these sequentially, so under load, requests may wait in a queue. Joining the resulting audio files gives you a single, coherent output without paying for multiple small headers.

This approach ensures you maximize the character limit per request, reducing the total number of API calls needed for a full document.

  • Split text into 4096-character segments.
  • Generate audio for each segment.
  • Join files into one final audio track.

Caching Results

Since generated audio is not stored by the API but returned in the response, caching locally prevents redundant synthesis. If your app reads static legal notices or standard instructions, save the MP3 or WAV files and serve them directly. This saves characters and reduces latency for repeat users.

Cache keys should include the voice, speed, and language parameters, as these affect the output.

Character Count Optimization

Spaces and punctuation count as characters, so clean your input text before sending it. Remove unnecessary whitespace, redundant phrases, or verbose legal jargon that doesn’t change the meaning. This directly lowers your $0.01 per 1,000 characters cost.

Always test the character count of your input string. For example, a 50-character sentence costs $0.0005. Optimizing phrasing can save significant credits over thousands of requests.

Testing the Integration

Sound wave illustration for: Testing the Integration

Start by signing up via Google to receive $0.50 in trial credit, valid for seven days. This grants approximately 50,000 characters, allowing you to test Portuguese integration without immediate payment setup.

Use this balance to verify voice quality and API connectivity before committing to USDT top-ups. Ensure your initial requests succeed before scaling to production volumes.

Using the Free Trial

Sign in with Google to instantly activate the $0.50 trial credit. This amount covers roughly 50,000 characters, providing ample room to test multiple Portuguese voices and formats.

The trial expires in seven days, so prioritize testing your most critical text snippets. If you prefer a password-based account, note that it does not include this initial credit.

  • Google sign-up grants $0.50 credit
  • Valid for 7 days
  • Covers ~50,000 characters

Validating Audio Quality

Download generated audio files in MP3, WAV, or OPUS formats. Listen for clarity in Portuguese phonemes, ensuring voices like Nova or Luna sound natural for your legal or informational content.

Verify that the language parameter correctly forces Portuguese detection, preventing fallback to English for Latin-script text. Check that the synthetic watermark is present but inaudible.

  • Test MP3, WAV, OPUS outputs
  • Verify Portuguese phoneme clarity
  • Check synthetic watermark presence

Performance Testing

Measure generation time against the expected real-time ratio of 25 characters per second. Short phrases may take a few seconds due to processing queues.

Monitor request latency under load to understand queue behavior. Ensure your application handles responses within reasonable timeframes, keeping the 60 requests-per-minute rate limit in mind.

  • Expect ~25 chars/sec generation
  • Account for queue latency
  • Respect 60 req/min limit

Deployment Considerations

Sound wave illustration for: Deployment Considerations

Deploying your Portuguese TTS integration requires realistic expectations about latency and infrastructure scaling. Requests are processed one after another, so under load a request may wait in a queue.

Understanding these constraints helps you design resilient app architectures that handle variable load without degrading user experience.

Latency Expectations

Typical speed is roughly real-time (25 characters per second) for long texts. Short phrases may take a few seconds to generate. Under load, requests wait in a queue, so total time includes both processing and waiting.

  • Long texts: ~1 second per 25 characters
  • Short phrases: few seconds generation time
  • Queue time varies by concurrent requests

Queue Management

Requests are processed one after another. If you send multiple rapid requests, later ones will wait in line. Implement exponential backoff or retry logic to handle temporary delays gracefully.

  • Sequential processing model
  • Implement retry logic with backoff
  • Monitor queue depth for optimal UX

Scalability

The API supports 60 requests per minute per key. For higher throughput, consider caching frequently used phrases or splitting long documents into chunks. No SLA or uptime guarantee is provided.

  • Rate limit: 60 requests/minute per key
  • Cache common phrases to reduce calls
  • Split long documents into 4096-char chunks
Deployment Considerations

Support and Resources

Sound wave illustration for: Support and Resources

Support is by email only. Since we do not offer phone support or live chat, email is our primary channel for resolving unique technical challenges.

Documentation Links

Our comprehensive documentation covers all API endpoints, voice presets, and Portuguese language nuances. You can access the full reference guide at https://abc777.info/docs/ to understand request shapes and response formats.

  • https://abc777.info/docs/
  • https://abc777.info/pricing/

Email Support

For specific issues or integration help, please contact us via email. We do not have a phone number or live chat, so email remains our only support channel. Include your API key and request details for faster resolution.

Community Examples

While we do not host a dedicated forum, developers can find community-driven examples in public repositories. These examples often demonstrate how to handle Portuguese text splitting and voice selection effectively.

Common Pitfalls

Sound wave illustration for: Common Pitfalls

Developing legal apps in Portuguese often leads to subtle integration errors. Users frequently assume the API handles language nuances automatically, but misconfigurations can result in robotic or inaccurate speech. Understanding these common pitfalls early saves debugging time and ensures your legal documents sound professional.

Another frequent issue is ignoring character limits or format requirements. The API enforces strict boundaries, and exceeding them causes silent failures or malformed audio. Knowing these constraints upfront prevents unexpected behavior during high-volume document processing.

Language Detection Issues

The API guesses the language from the script if you omit the language field. Latin text defaults to English, which causes Portuguese text to sound like an English speaker trying to pronounce Portuguese words. For accurate results, always explicitly set language: 'pt'.

This is especially critical for legal documents where precise pronunciation of technical terms matters. Without explicit language tags, the TTS engine may misinterpret regional nuances or legal jargon, leading to confusing audio for end-users.

  • Always set language to pt for Portuguese text.
  • Latin script defaults to English, not Portuguese.
  • Explicit tags ensure correct pronunciation rules.

Character Limit Exceeds

Each request supports a maximum of 4096 characters in the input field. Exceeding this limit results in a failed request, and no audio is generated. Spaces and punctuation count toward this limit, so long legal contracts often require splitting.

You must implement client-side logic to split text into chunks, generate audio for each, and join the files. Failure to handle this manually leads to lost data or incomplete audio files.

Ensure your code validates character counts before sending requests to avoid unnecessary API calls and wasted credits.

  • Max input length is 4096 characters.
  • Spaces and punctuation count as characters.
  • Split long texts manually before sending.

Format Mismatches

The API returns audio in formats like mp3, wav, opus, flac, or pcm. If your application expects a different format, you may encounter playback issues or encoding errors. Always specify the response_format field to match your player’s capabilities.

Mismatched formats can also cause bandwidth issues. For example, returning wav files for large documents consumes significantly more data than mp3. Choose the format that balances quality and efficiency for your use case.

Ensure your backend handles the binary response correctly and sets the appropriate Content-Type header when serving the audio to clients.

  • Specify response_format explicitly.
  • Match format to player capabilities.
  • Use mp3 for bandwidth efficiency.

Advanced Usage

Sound wave illustration for: Advanced Usage

Go beyond basic synthesis by tuning voice speed to match your legal content’s pacing, ranging from 0.25x to 4.0x. You can also rotate among eight distinct voices to add variety to long-form legal documents or instructional guides.

For long texts exceeding 4096 characters, split your input into parts, generate each audio segment, and join them seamlessly. This ensures high-quality output without hitting request limits.

Speed Adjustment

Adjust the speed parameter between 0.25 and 4.0 to customize pacing. Slower speeds improve clarity for complex legal terms, while faster speeds suit brief updates.

This works with any voice, allowing you to fine-tune the listening experience for different document types.

  • Use 0.5-0.75x for dense legal texts
  • Use 1.5x for quick status updates
  • All 8 voices support speed changes

Multiple Voices

Select from 8 presets like aria for narrations or atlas for news-style readings. Each voice offers a distinct tone, from warm to neutral.

You can switch voices per request to create dynamic audio documents, such as using sage for instructions and milo for conversational sections.

  • 8 distinct voice presets
  • Mix voices per document
  • No custom cloning needed

Long Document Handling

Split text into chunks of up to 4096 characters. Generate each chunk individually and concatenate the resulting audio files.

This approach bypasses character limits while maintaining consistent audio quality across the entire document.

Note that requests are processed sequentially, so longer documents may take time proportional to their length.

  • Max 4096 chars per request
  • Concatenate generated audio files
  • Sequential processing applies

Data Privacy

Sound wave illustration for: Data Privacy

Your input text is used strictly to generate the audio file and is not stored for training purposes. This ensures that your legal documents or informational content remain private during the synthesis process.

Input Text Storage

The text you send in the request body is processed in real-time to produce the audio output. It is not retained after the synthesis is complete, ensuring your content data remains transient and secure.

Audio Storage Policy

Generated audio files are returned directly in the API response and are not stored on our servers. You own the generated audio, and we do not keep copies for any other purpose.

Billing Data

We retain request metadata, including timestamp, character count, and status, solely for accurate billing and troubleshooting. This minimal data ensures you are charged correctly for the characters processed in each request.

Future Updates

Sound wave illustration for: Future Updates

The API roadmap focuses on expanding language coverage and refining voice presets based on community feedback. Future releases will include more granular control over speech parameters and potential format updates.

Future releases will include more granular control over speech parameters and potential format updates, ensuring the service remains a reliable tool for indie developers integrating multilingual content into their applications.

New Languages

We are actively evaluating additional languages for inclusion in the supported list. Priority is given to regions with significant developer demand, aiming to expand beyond the current 23 languages without compromising voice quality.

No specific dates are guaranteed, but new language support will be announced via the changelog and documentation updates.

  • Expansion beyond the current 23 supported languages
  • Focus on high-demand regional variants

Voice Updates

These updates are backward compatible, ensuring existing integrations remain stable without code changes.

  • Periodic voice quality improvements
  • Backward-compatible updates

Feature Roadmap

Future features may include advanced speed controls, new response formats, or enhanced error reporting. We aim to maintain the simple, OpenAI-compatible interface while adding useful capabilities for complex use cases.

Specific features will be prioritized based on developer needs and technical feasibility, with updates shared through the documentation.

  • Potential new response formats
  • Enhanced error reporting
  • Advanced speed controls

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. Under heavy load, processing time increases slightly due to single-threaded synthesis, but the system remains reliable for batch jobs.

Avatar of the voice aria
ariafemale
Avatar of the voice nova
novafemale
Avatar of the voice luna
lunafemale
Avatar of the voice sage
sagefemale
Avatar of the voice felix
felixmale
Avatar of the voice milo
milomale
Avatar of the voice atlas
atlasmale
Avatar of the voice orion
orionmale

23 languages

Any voice speaks any of these languages.

Sources and further reading

  1. Wikipedia
  2. FFmpeg documentation
  3. OpenAI API reference: create speech
  4. Python documentation
  5. Creative Commons Attribution 4.0
  6. W3C WAI: making audio and video accessible
  7. ISO 639 language codes
  8. MDN: Web Speech API
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. TRON developer hub: TRC-20
  11. openai-node on GitHub
  12. curl documentation

More on this site