Integrate Our Text-to-Speech API for HR Developers

By LinguaSync editorial team · Updated 2026-11-18

This page provides practical integration guides for HR developers and instructional designers who need to convert training materials into audio. Learn how to authenticate, send text, and receive synthesized voiceovers using standard tools like cURL or the OpenAI SDK. We cover model selection, voice presets, and audio formats to help you build consistent, multilingual learning content without the overhead of studio recording.

Find clear examples for handling rate limits, managing long documents, and troubleshooting common errors. Use these steps to integrate our API into your existing LMS or internal platforms. Generate MP3, WAV, or OPUS files from plain text, ensuring your team has engaging audio content that scales with your organization's needs.

Integrate Our Text-to-Speech API for HR Developers

Frequently asked questions

How do I generate an API key?

Sign up on the /get-api-key/ page using Google or an email and password. Your account page displays your active API key, balance, and usage statistics. You can issue a new key at any time, which immediately invalidates the previous one.

Does the API support asynchronous processing?

No, the API processes requests synchronously. You send a POST request and receive the audio file in the response. Requests are processed sequentially, so under load, your request may wait in a queue before generating the audio.

Can I use the same key for multiple developers?

Yes, each account has one active key that can be shared among your team. The rate limit of 60 requests per minute applies to the key itself, so multiple developers sharing it will share that throughput capacity.

What is the maximum text length per request?

The maximum input text length is 4096 characters per request. For longer texts, you must split the content into parts of up to 4096 characters and join the resulting audio files after generation.

How do I specify the language in the request?

Include the optional language field with an ISO code in your JSON body. If omitted, the system guesses the language from the script, defaulting to English for Latin text. Explicitly setting it ensures accuracy for non-English content.

Is the OpenAI SDK fully compatible with this API?

Yes, the request shape matches the OpenAI speech endpoint. You can use official OpenAI SDKs by changing the base_url to https://api.playck222.com/v1 and providing your site-specific API key for authentication.

What happens if I exceed the character limit?

The API accepts up to 4096 characters per request. If you send more, the request will likely fail or truncate depending on implementation. For longer content, split your text into multiple requests of 4096 characters or less.

Do I need to install any libraries to use the API?

No specific library is required. You can use standard HTTP clients in any language. Alternatively, you can use the OpenAI SDK by adjusting the base URL. No custom SDK or mobile library is needed.

Can I specify a voice ID in the cURL command?

Yes, include the voice field in the JSON body of your cURL command. Choose from eight presets like aria, nova, or atlas. The command structure mirrors the OpenAI speech endpoint for easy integration.

How long does the API key remain valid?

API keys do not expire. You can issue a new key at any time, which immediately stops the old one. Your balance and usage history remain associated with your account regardless of key rotation.

Is there a sandbox environment for testing?

No separate sandbox environment exists. You use the production API endpoint https://api.playck222.com/v1. You can test with your free trial credit of $0.50 or by making small requests to verify integration.

What is the difference between tts-1 and tts-1-hd?

Both models use the same engine and have the same price of $10 per million characters. The only difference is the model identifier string you send in the request body.

How do I handle errors in my integration?

Check the HTTP status code in the response. If synthesis fails, the charge is returned in full. Monitor response headers and body for error details to debug issues like rate limits or invalid parameters.

Can I use the API with Python or JavaScript?

Yes, since it uses standard HTTP and JSON, it works with any language. Use the OpenAI SDK for Python or JavaScript by setting the base URL to https://api.playck222.com/v1 and providing your API key.

First request

curl

curl https://api.playck222.com/v1/audio/speech \
  -H "Authorization: Bearer $TTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"tts-1","voice":"aria","input":"Hello from the API.","response_format":"mp3"}' \
  --output hello.mp3

Python (openai)

from openai import OpenAI

client = OpenAI(base_url="https://api.playck222.com/v1", api_key="tts-...")

with client.audio.speech.with_streaming_response.create(
    model="tts-1", voice="nova", input="Hello from Python.", response_format="mp3"
) as response:
    response.stream_to_file("hello.mp3")

Node.js (openai)

import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({ baseURL: "https://api.playck222.com/v1", apiKey: process.env.TTS_API_KEY });
const res = await client.audio.speech.create({ model: "tts-1", voice: "milo", input: "Hello from Node.js." });
fs.writeFileSync("hello.mp3", Buffer.from(await res.arrayBuffer()));
voice
ariafemale
novafemale
lunafemale
sagefemale
felixmale
milomale
atlasmale
orionmale
language
arالعربية
zh中文
daDansk
nlNederlands
enEnglish
fiSuomi
frFrançais
deDeutsch
elΕλληνικά
heעברית
hiहिन्दी
itItaliano
ja日本語
ko한국어
msBahasa Melayu
noNorsk
plPolski
ptPortuguês
ruРусский
esEspañol
swKiswahili
svSvenska
trTürkçe

Get Your API Key

Sound wave illustration for: Get Your API Key

Start by creating your account on the /get-api-key/ dashboard. You can sign up quickly using your Google credentials or by setting up an email and password. This process is specific to the site domain, so ensure you are on playck222.com to access the correct credentials for your team.

Once registered, you will receive a unique API key to authenticate your requests. This key allows your HR applications to generate consistent, multilingual voiceovers for training materials without the overhead of studio recording.

Sign up with Google or email on the dashboard

Sign up with Google or email on the dashboard

Access the /get-api-key/ page to create your account. You can choose to authenticate via Google for speed or use a standard email and password setup. Accounts created with email do not start with trial credit, while Google sign-ups receive $0.50 of credit valid for 7 days.

This initial step grants you immediate access to the dashboard where you can manage your integration keys and monitor usage metrics for your team's audio content generation needs.

  • Google OAuth for quick setup
  • Email/password option available
  • $0.50 trial credit for Google sign-ups

Locate your key in the account settings

Locate your key in the account settings

After signing up, navigate to your account settings to view your active API key. The dashboard displays your current balance, characters remaining, and a ready-to-use cURL example for immediate testing.

Your key begins with 'tts-' and is used in the Authorization header. Only one key is active per account at any given time, ensuring simple credential management for your development team.

Revoke old keys instantly when issuing new ones

If you need to rotate your credentials, you can issue a new key at any time from the dashboard. When you generate a new key, the previous one stops working immediately.

This instant revocation ensures secure access control for your HR team's applications, allowing you to update credentials without waiting for session timeouts or manual deactivation processes.

Make Your First Request with cURL

Sound wave illustration for: Make Your First Request with cURL

Generate audio files directly from your terminal using a simple cURL command. This method is ideal for quick validation of your API integration before building larger workflows for your HR training materials.

Ensure your API key is active and you have sufficient balance. The request processes synchronously, so wait for the audio file response before proceeding to the next chunk of text.

Use POST https://api.playck222.com/v1/audio/speech

Send a POST request to the speech endpoint. This URL handles the synthesis of your provided text into audio, supporting formats like MP3, WAV, OPUS, FLAC, and PCM.

Include your Bearer token in the Authorization header

Authenticate your request by including your unique API key in the Authorization header. Use the format Bearer tts-... to identify your account and apply your specific rate limits.

Send text in the 'input' field of the JSON body

Structure your request body in JSON. Include the model (tts-1 or tts-1-hd), voice preset, and the input text. Keep the text under 4,096 characters to ensure smooth processing.

  • Use tts-1 or tts-1-hd for the model
  • Specify a voice like aria or atlas
  • Keep input under 4,096 characters

Using the OpenAI SDK

Sound wave illustration for: Using the OpenAI SDK

To integrate our Text-to-Speech API with your HR learning platform, configure the OpenAI SDK by setting the base_url to https://api.playck222.com/v1. This allows you to use the standard SDK methods without custom wrappers, leveraging familiar code structures for your development team.

Set base_url to https://api.playck222.com/v1

Update your SDK client configuration to point to our API endpoint. This single change enables the official OpenAI SDK to communicate directly with our speech synthesis engine, maintaining compatibility with existing libraries.

Use the standard 'audio' method for speech generation

Invoke the standard audio.speech method to generate audio files. Pass your training text in the input field, select a voice like Aria or Atlas, and specify the desired format. The SDK handles the JSON serialization and response parsing automatically.

Pass your API key as the bearer token

Authenticate your requests by passing your unique API key as a Bearer token in the Authorization header. Ensure your key is active and has sufficient balance. Failed synthesis requests will not incur charges, preserving your training budget.

Supported Audio Formats

Sound wave illustration for: Supported Audio Formats

Choose the right audio format to match your learning platform’s capabilities and your team’s storage needs. Each format balances quality, file size, and compatibility differently, ensuring your training modules load quickly and play reliably across devices.

Select MP3 for broad compatibility with most web-based learning players. Opt for WAV when you need uncompressed, high-quality audio for archival purposes. Use OPUS to significantly reduce bandwidth usage while maintaining clear speech.

MP3 for web-based learning players

MP3 is the standard for web delivery, offering a good balance between file size and audio quality. It works seamlessly with almost all modern learning management systems and mobile apps, ensuring your HR training content plays without issues for remote employees.

This format is ideal for general-purpose training modules where quick loading times are essential for maintaining learner engagement across various devices and network conditions.

  • Widely supported by LMS platforms
  • Small file sizes for faster loading
  • Consistent playback across mobile and desktop

WAV for high-quality archival storage

WAV provides uncompressed audio, preserving the full fidelity of the synthesized voice. This makes it the best choice for creating master copies of your training content that need to be stored long-term without quality degradation.

Use WAV when you need the highest possible audio quality for professional presentations or when archiving critical compliance training materials that must remain pristine for future reference.

  • Uncompressed, lossless quality
  • Ideal for master archives
  • Preserves full voice nuance

OPUS for efficient streaming and bandwidth saving

OPUS offers superior compression efficiency, significantly reducing data usage for your users. This is particularly useful for training modules accessed on mobile networks or in regions with limited bandwidth.

Choose OPUS when optimizing for speed and cost-efficiency, especially if your training materials are accessed frequently by large teams using variable internet connections.

  • High compression ratio
  • Low bandwidth consumption
  • Optimized for mobile networks

Available Models and Voices

Sound wave illustration for: Available Models and Voices

Our TTS API offers two model options, tts-1 and tts-1-hd, which utilize the identical synthesis engine and pricing structure. This means you can use the HD variant without any change in cost or processing logic, keeping your HR learning budgets predictable.

tts-1 and tts-1-hd use the same engine and price

Both models use the same engine and price. You only need to switch the model parameter in your API request when you require the enhanced audio fidelity of the HD variant, making it easy to experiment with quality without financial risk.

Select from 8 presets like Aria, Atlas, and Milo

Choose from eight distinct voice presets to match your corporate identity. Our library includes warm narrators like Aria, friendly conversationalists like Milo, and neutral news readers like Atlas. Every voice supports all 23 languages, ensuring consistent tone across your global training modules.

  • Aria: Warm, clear narrator for general instructions
  • Atlas: Neutral, professional tone for news updates
  • Milo: Friendly, conversational style for soft skills
  • Felix: Energetic voice for promotional content

Assign voices based on training content tone

Available Models and Voices

Handling Rate Limits

Sound wave illustration for: Handling Rate Limits

Rate limits ensure stable generation for your training pipelines. Each API key allows 60 requests per minute once active. This supports steady batch processing for large employee onboarding kits or monthly compliance updates without overwhelming the service.

Limit is 60 requests per minute per key

After your initial trial or first top-up, you can send up to 60 synthesis requests per minute. This throughput is sufficient for generating audio for most standard training modules in reasonable timeframes.

New accounts start with 10 requests per minute

New accounts begin with a lower limit of 10 requests per minute. This ensures fair usage during the initial testing phase before you commit to a paid balance.

Increase limits after the first top-up

Your limit increases to the full 60 requests per minute immediately after your first top-up. Simply add USDT (TRC-20) to your account to unlock this capacity for your team's workflow.

Managing Long Training Documents

Sound wave illustration for: Managing Long Training Documents

For extensive compliance modules or multi-hour onboarding sequences, a single request cannot exceed 4,096 characters. Your application must handle text segmentation before sending data to the API, ensuring no input field is truncated or rejected due to size constraints.

Each segment is processed independently, allowing your system to manage load efficiently. This approach prevents timeouts during the synthesis of large documents, keeping your HR LMS integration stable even when processing thousands of characters of training material.

Split text into chunks of up to 4,096 characters

Before calling the speech endpoint, divide your source text into segments, each containing no more than 4,096 characters. Spaces and punctuation count toward this limit. This ensures every request fits the API’s maximum capacity without error.

  • Preserve sentence boundaries where possible to maintain audio clarity
  • Count spaces and punctuation as single characters

Generate audio for each chunk separately

Send each segmented chunk as an individual POST request to the /v1/audio/speech endpoint. The API processes these sequentially under the rate limit, returning a distinct audio file for each segment. This allows you to handle failures per chunk without losing the entire document.

Join files client-side or via batch processing

Once all audio files are received, concatenate them in your preferred order. You can merge these files client-side using JavaScript or server-side using a library like FFmpeg. This creates a single, seamless audio track for your learners, masking the segment boundaries.

Common Errors and Troubleshooting

Sound wave illustration for: Common Errors and Troubleshooting

Even with a robust HR training workflow, API calls can occasionally fail. Understanding these common HTTP responses helps your integration handle errors gracefully without interrupting the learning experience for your team.

Most issues stem from authentication, rate limits, or temporary synthesis delays. Below are the specific steps to resolve each error type efficiently.

401 Unauthorized: Check your API key validity

Ensure your Authorization: Bearer header contains a valid key issued from your dashboard. If you issued a new key recently, the old one stopped immediately. Verify the key matches your account's active token.

429 Too Many Requests: Respect the rate limit

New accounts start with 10 requests per minute, increasing to 60 after the first top-up. If you hit the limit, pause briefly or implement exponential backoff in your script. Ensure you are not exceeding the per-key quota.

500 Internal Error: Retry failed synthesis requests

Synthesis failures are often transient. If the engine returns a 500 error, retry the request once. Failed requests are free, so retrying does not incur extra charges. Check your input text length.

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. This preset is particularly effective for delivering consistent audio content across large teams and diverse departments.

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. IETF RFC 7845: Ogg Opus
  3. Python documentation
  4. openai-node on GitHub
  5. OpenAI API reference: create speech
  6. W3C WAI: making audio and video accessible
  7. Node.js documentation
  8. ISO 639 language codes
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. curl documentation
  11. Tether (USDT)
  12. TRON developer hub: TRC-20

More on this site