Frequently asked questions
How do I get an API key?
Sign up on the /get-api-key/ page using Google or email plus password. Accounts are specific to this site. Once registered, your dashboard displays your active API key, current balance, and usage statistics immediately, allowing you to start making requests without waiting for approval.
Can I use the OpenAI Python SDK?
Yes. The API accepts the same request shape as OpenAI’s speech endpoint. You can use the official OpenAI SDKs by simply changing the base URL to https://api.pk40.info/v1 and providing your site-specific API key. This allows for easy integration into existing Python workflows.
What is the base URL for the API?
The base URL is https://api.pk40.info/v1. You should configure your SDK or HTTP client to point to this address. All API requests, including speech synthesis and voice listing, are routed through this domain, ensuring compatibility with standard OpenAI-style request structures.
How do I specify a voice?
Include the voice field in your JSON request body. You can choose from eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. These voices support all 23 available languages. If you do not specify a language, the system guesses it from the text script.
What formats are available?
You can request audio in mp3, wav, opus, flac, or pcm formats. Specify your preference using the response_format field in the request body. This flexibility allows you to choose the best balance between file size and quality for your specific SaaS notification pipeline requirements.
What happens if I hit the rate limit?
The limit is 60 requests per minute per key (10 per minute before your first top-up). Requests are processed sequentially, so exceeding the limit may cause your request to wait in a queue. Failed requests are free, but successful ones consume your character balance.
How long are requests queued?
Requests are processed one after another, so under load, a request may wait in a queue. Typical speed is roughly real-time, generating about 25 characters of text per second. Short phrases may take a few seconds to synthesize and return the audio file.
Do I need to handle chunking for long texts?
Yes. The API accepts up to 4096 characters per request. For longer texts, you must split the input into parts of this size, send separate requests, and join the resulting audio files on your end. This ensures efficient processing within the character limits.
Is SSML supported?
No. The API does not support SSML, phoneme dictionaries, or custom pronunciation lexicons. It processes plain text input. You cannot use emotion tags or custom voice cloning. The service focuses on straightforward text-to-speech conversion without complex markup language support.
How do I authenticate requests?
Include your API key in the Authorization header as a Bearer token. The format is Authorization: Bearer tts-.... You can generate or rotate your key via the dashboard. Each account has one active key, and issuing a new one immediately invalidates the old one.
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 via the dashboard, which immediately stops the old one. This allows you to rotate keys for security without downtime.
What is the maximum input length?
The maximum input length is 4096 characters per request. Spaces and punctuation count toward this limit. If your text exceeds this length, you must split it into smaller chunks, generate audio for each, and concatenate the resulting audio files in your application logic.
How do I handle audio file downloads?
The API returns the audio file directly in the response body. You do not need to poll for a URL or download from a storage bucket. The generated audio is returned immediately upon synthesis completion and is not stored by the service, so you must save it locally.
Is there a webhook for completion?
No. The API is synchronous; it returns the audio file directly in the response once synthesis is complete. There are no webhooks for completion or status updates. You must handle the response in your client code immediately after sending the request to the endpoint.
First request
curl
curl https://api.pk40.info/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.mp3Python (openai)
from openai import OpenAI
client = OpenAI(base_url="https://api.pk40.info/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.pk40.info/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 | |
|---|---|
aria | female |
nova | female |
luna | female |
sage | female |
felix | male |
milo | male |
atlas | male |
orion | male |
| language | |
|---|---|
ar | العربية |
zh | 中文 |
da | Dansk |
nl | Nederlands |
en | English |
fi | Suomi |
fr | Français |
de | Deutsch |
el | Ελληνικά |
he | עברית |
hi | हिन्दी |
it | Italiano |
ja | 日本語 |
ko | 한국어 |
ms | Bahasa Melayu |
no | Norsk |
pl | Polski |
pt | Português |
ru | Русский |
es | Español |
sw | Kiswahili |
sv | Svenska |
tr | Türkçe |
Get Your API Key
Sign up for an account on pk40.info using your Google credentials or a standard email and password. This creates your personal dashboard where you can manage your API key, view your current balance, and track usage metrics. Accounts are tied to this specific site, so ensure you are registered on the correct domain.
Once registered, you will receive a unique API key starting with tts-. This key is your sole credential for authenticating requests to the API endpoint. You can view it directly in your dashboard alongside your remaining character count and trial status if applicable.
Sign up with Google or email
Register via the /get-api-key/ page using either Google or a traditional email/password combination. Google sign-ups include a $0.50 free trial valid for 7 days, while email-only accounts start without trial credit. Your account is created instantly and ready for use.
The registration process is simple and does not require a credit card. Once verified, you are immediately assigned an API key and can begin sending requests to generate audio files.
- Google or email/password registration
- $0.50 trial credit for Google sign-ups
- Instant account creation
Access key from dashboard
Log in to your dashboard to view your active API key, current balance, and usage statistics. The dashboard displays your key, remaining characters, and a ready-to-use cURL example. You can also see your trial status if applicable.
All account details are updated in real-time. You can copy your key directly from the interface to use in your application's configuration or code snippets.
- View API key and balance
- Check usage statistics
- Copy key for integration
Regenerate key if needed
You can regenerate your API key at any time from the dashboard. When you issue a new key, the previous one becomes invalid immediately. This is useful if you suspect a key has been exposed or want to rotate credentials for security.
Ensure your application is updated with the new key before the old one expires. There is no downtime during regeneration, but your old key will stop working at once.
- Regenerate key anytime
- Old key invalid immediately
- No downtime during rotation
First Request with cURL
Generate speech by sending a POST request to the speech endpoint. Provide the text payload, select a voice preset, and specify the desired audio format. The API processes the input and returns the synthesized audio file directly in the response body, allowing you to save or play it immediately.
If synthesis fails, the request is free, and no charge is applied. Check the HTTP status code to confirm success or identify issues like invalid input. Handle the response by saving the file. The audio file includes an inaudible watermark marking it as synthetic speech.
Basic speech generation
Send a POST request to https://api.pk40.info/v1/audio/speech with your API key in the Authorization header. Include the text in the input field (up to 4096 characters) and choose a model like tts-1. The API processes the text and returns the audio file directly in the response body.
- Endpoint: POST https://api.pk40.info/v1/audio/speech
- Model: tts-1 or tts-1-hd
- Max input: 4096 characters
Setting voice and format
Customize the output by specifying a voice (e.g., aria, nova, felix) and format (mp3, wav, opus, flac, pcm). You can also adjust the speed between 0.25 and 4.0. The language is optional but recommended for non-English text to ensure accurate pronunciation.
- Voices: aria, nova, luna, sage, felix, milo, atlas, orion
- Formats: mp3, wav, opus, flac, pcm
- Speed: 0.25–4.0
Understanding response
The API returns the audio file directly in the response body. If synthesis fails, the request is free, and no charge is applied. Check the HTTP status code to confirm success or identify issues like invalid input. Handle the response by saving the file. The audio file includes an inaudible watermark marking it as synthetic speech.
Using OpenAI SDKs
Integrating our TTS API into your SaaS notification pipeline is straightforward if you already use the OpenAI ecosystem. You simply point your client to our API base URL and use your Startup Audio Lab key. This allows you to keep your existing code structure while switching providers.
Our service mirrors the standard request shape exactly, meaning no custom adapters are required for Python or Node.js clients. This compatibility lets you generate audio files for user alerts or interface prompts with minimal code changes. Note that this is not our own SDK; you are using the official OpenAI libraries directed at our endpoint.
Change base_url
Update your client configuration to use https://api.pk40.info/v1 as the base URL. This directs all requests to our infrastructure while maintaining the standard SDK behavior.
Keep your authentication header set to Bearer tts-... using your unique key from the dashboard.
- Base URL: https://api.pk40.info/v1
- Auth Header: Bearer tts-<your-key>
Use official SDKs
Use any official OpenAI SDK (Python, Node.js, etc.). Since we mirror the request shape, no custom adapters are needed. Note that this is not our own SDK.
This approach works seamlessly with both the Python and JavaScript/Node.js client libraries, allowing you to leverage existing community examples.
Compatible request shape
Send a JSON body with fields like model, input, voice, and response_format. The structure matches the OpenAI speech endpoint exactly.
You can specify tts-1 or tts-1-hd as the model. The SDK handles serialization, so you just pass your text and desired voice preset.
Supported Formats
Choose the right audio format for your SaaS notification pipeline. MP3 is the standard for web delivery, offering a good balance of quality and file size for user-facing interfaces.
MP3 for web
Use MP3 for most client-side playback. It ensures broad compatibility across mobile browsers and desktop applications without significant bandwidth overhead.
WAV for quality
Select WAV when you need uncompressed audio for high-fidelity archival or specific processing pipelines. This format preserves the full signal detail generated by our TTS engine.
FLAC and OPUS options
FLAC provides lossless compression for storage efficiency without quality loss. OPUS is ideal for low-bandwidth environments, offering excellent audio quality at minimal bitrates.
- Set via the
response_formatparameter in your request.
Rate Limits and Queues
The API enforces a hard limit of 60 requests per minute per key. This ceiling ensures fair usage across all accounts and prevents any single user from monopolizing the generation engine. If you exceed this threshold, subsequent requests will receive a 429 Too Many Requests error until the window resets.
For accounts that haven't topped up yet (including those with trial credit), the limit is stricter: only 10 requests per minute are allowed. This low threshold encourages early payment integration without blocking legitimate trial usage. Once you add funds, your standard 60 RPM limit applies immediately.
60 requests per minute
Standard accounts can process up to 60 synthesis requests every 60-second sliding window. This rate is sufficient for most SaaS notification pipelines, allowing you to generate audio for user alerts or system updates without significant delay.
We recommend batching independent requests where possible. Since each request is charged per 1,000 characters, efficient batching reduces overhead while staying within your per-minute quota.
- Limit: 60 RPM for funded accounts
- Window: Sliding 60-second interval
- Error: HTTP 429 when exceeded
10 requests before top-up
Accounts created via email/password start without trial credit and are restricted to 10 requests per minute. Google-signup accounts receive $0.50 trial credit but still face the 10 RPM limit until the first top-up is confirmed.
This restriction ensures that high-volume usage doesn't degrade service for trial users. Top-ups via USDT (TRC-20) are processed automatically, usually within minutes, restoring your full 60 RPM capacity.
- Pre-top-up limit: 10 RPM
- Applies to all new accounts
- Restored automatically after payment
Queue handling under load
Requests are processed sequentially. If multiple requests arrive simultaneously, they are queued and handled one after another. This ensures consistent output quality but means that under heavy load, generation times may increase.
For long texts, splitting into 4,096-character chunks and joining the audio files works best. Since each chunk is processed in order, your final audio will be coherent even if individual requests wait in the queue.
- Sequential processing
- Queues form under high load
- No priority queue

Error Handling
When synthesis fails, you are not charged. This applies to any request that does not successfully return an audio file, ensuring your budget stays predictable even during transient errors.
Failed requests are free
If the API returns an error status or the connection drops during generation, the character count is not deducted from your balance. You only pay for successful audio deliveries.
Check status codes
Monitor the HTTP response code for each request. Standard 2xx codes indicate success. Non-2xx codes signal issues like invalid parameters or rate limits. Always check the response body for a specific error message to understand the cause.
- 400: Invalid parameters (e.g., text too long)
- 429: Rate limit exceeded
- 500: Internal server error
Retry logic
Implement exponential backoff for temporary failures. Since requests are processed sequentially, high load may cause delays. Retry with increasing intervals to avoid overwhelming the queue.
Voices and Languages
Our TTS engine uses eight distinct voice presets and supports 23 languages, allowing you to tailor audio output to your specific brand voice or user context. You can select any voice for any supported language, ensuring consistent quality across diverse notification types.
Each voice is based on licensed recordings from LibriTTS-R (CC BY 4.0) and LibriVox public-domain audiobook readings. The system handles language detection automatically, but explicit codes ensure accuracy for ambiguous scripts.
8 voice presets
Choose from four female and four male voices, each designed for specific tones. Options range from warm narrators to energetic promo styles, giving you granular control over user experience.
Every generated file carries an inaudible watermark marking it as synthetic speech, helping maintain transparency with your users regarding automated audio content.
- Female: aria (warm, clear narrator), nova (bright, upbeat), luna (soft, storytelling), sage (calm, instructional)
23 languages supported
The API supports Arabic, Chinese, Danish, Dutch, English, Finnish, French, German, Greek, Hebrew, Hindi, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese, Russian, Spanish, Swahili, Swedish, and Turkish. Any voice can speak any of these languages.
Note that Vietnamese, Indonesian, Thai, Ukrainian, Romanian, Czech, Bengali, and other languages are not supported. Ensure your target audience languages are covered before integration.
Language code usage
If the language field is omitted, the system guesses the language from the script. Latin script defaults to English. For non-English Latin text, explicitly set the language parameter to avoid mispronunciation.
Use standard ISO codes for the language field to ensure precise output, especially when mixing languages or using ambiguous scripts in your notification payloads.
Authentication
Secure your API key from the dashboard. Pass it in the header as Authorization: Bearer tts-... for every request.
Bearer token usage
Include the full key string after Bearer . The API validates the token on each call to ensure your account is active and has sufficient balance.
Key security
Treat your key like a password. It grants full access to your usage and billing. Do not expose it in client-side code or public repositories.
Single active key
You have one active key per account. Regenerate it anytime via the dashboard; the old key stops working immediately, ensuring no stale access persists.
Listen to the 8 voices
Each sample below was generated by this API from the same sentence. This reduces the time from account creation to your first generated audio file to just minutes.
23 languages
Any voice speaks any of these languages.
