API Documentation for Smart Home Voice Synthesis

By Heara editorial team · Updated 2026-11-18

This documentation provides the technical specifications for the Heara text-to-speech API, designed specifically for no-code smart home developers. You will find concrete examples for integrating natural voice synthesis into voice assistants and notifications using simple HTTP requests. The guide covers essential endpoints, parameter configurations, and error handling to ensure reliable audio output for your IoT projects.

We simplify voice integration by offering a transparent, straightforward API with realistic voices and clear pricing. This page details the request structure, supported formats, and rate limits so you can quickly generate audio files without managing complex infrastructure. Use this reference to connect your smart home automation workflows to our TTS engine efficiently.

API Documentation for Smart Home Voice Synthesis

Frequently asked questions

How do I get an API key?

Sign up on /get-api-key/ using Google or email plus password. Your account receives one active key. You can issue a new key at any time, which immediately invalidates the old one. Accounts created with email and password do not start with trial credit, while Google sign-ins receive $0.50 valid for 7 days.

Can I use the OpenAI SDK?

Yes. The request shape matches the OpenAI speech endpoint. Change the base_url to https://api.atk777apk.com/v1 and use your site's key. The official OpenAI SDKs work directly without modification. You can also use plain HTTP POST requests to the same endpoint structure.

What is the base_url for the API?

The base URL is https://api.atk777apk.com/v1. Use this for both the OpenAI SDK configuration and direct HTTP requests. All API calls, including speech synthesis and voice listing, originate from this domain. Ensure your Authorization header uses this base URL for authentication.

How do I specify a voice?

Include the voice parameter in your JSON body. Choose from eight presets: aria, nova, luna, sage, felix, milo, atlas, or orion. Each voice has a distinct tone, such as warm narrator or deep documentary. The voice parameter is required for every synthesis request.

What are the supported audio formats?

You can request mp3, wav, opus, flac, or pcm. Set the response_format field in your request body. These formats cover most smart home audio requirements. The API returns the audio file directly in the response based on your specified format preference.

How do I handle rate limits?

You are limited to 60 requests per minute per key. Before your first top-up, the limit is 10 requests per minute. Monitor your usage in the dashboard. If you exceed the limit, requests may queue or fail. Plan your text splitting and request timing accordingly.

What happens if I exceed the limit?

Requests are processed sequentially and may wait in a queue under load. If you exceed the rate limit, your requests will be delayed or rejected. Failed requests are free, so you do not lose credit if synthesis fails due to limits or errors.

Is there an error message for failures?

Yes, the API returns standard HTTP error codes and messages when synthesis fails. Failed requests are free, and the charge is returned in full. You can retry failed requests after addressing any issues indicated by the error response.

How do I split long texts?

Split your input into parts of up to 4096 characters each. Send each part as a separate POST request. Then join the resulting audio files on your end. This ensures compliance with the character limit per request while handling longer content.

Can I change my API key?

Yes, you can issue a new key at any time from your account dashboard. When you generate a new key, the old one stops immediately. This allows you to revoke access instantly if needed. You maintain only one active key per account.

Does the old key stop immediately?

Yes. When you issue a new API key, the previous one becomes invalid immediately. Any requests made with the old key after the switch will fail. This ensures secure key rotation without waiting for a timeout period.

How do I check available voices?

Send a GET request to /v1/voices. This endpoint returns details about all available voices, languages, and formats. Use this to verify which voices support your target language before making synthesis requests.

Is there a models endpoint?

Yes, use GET /v1/models to retrieve available model information. The supported models are tts-1 and tts-1-hd. Both use the same engine and price. This endpoint helps you verify model availability and configuration options programmatically.

How do I set the language?

Include the language parameter with an ISO code in your request. If omitted, the system guesses the language from the script, defaulting to English for Latin text. For non-English Latin-script text, explicitly set the language to ensure accurate synthesis.

First request

curl

curl https://api.atk777apk.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.atk777apk.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.atk777apk.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

Access the /get-api-key/ page to create your account. You can sign in with Google or use a standard email and password. The dashboard displays your active API key, current balance, and character usage statistics immediately upon login.

Each account maintains a single active key. You can generate a new key at any time via the dashboard; the previous key stops working instantly, ensuring simple credential rotation without downtime for your smart home integrations.

Sign Up Process

Sign Up Process

Navigate to /get-api-key/ and choose Google authentication or email registration. Google sign-ups receive a $0.50 trial credit valid for 7 days. Email-based accounts start with zero balance.

Once registered, your dashboard shows your API key, character balance, and usage history. Top-ups via USDT (TRC-20) are credited automatically within minutes.

  • Google or email registration
  • Instant dashboard access
  • Trial credit for Google sign-ins

Key Management

Key Management

Your account supports one active API key at a time. Use the Authorization: Bearer tts-... header in all requests. The key is tied to your specific site account.

Generate a new key via the dashboard to invalidate the old one immediately. This ensures that if a key is exposed, you can revoke access instantly without waiting for a refresh cycle.

  • One active key per account
  • Instant invalidation on rotation
  • Bearer token format

Revoking Keys

Revoking is automatic when you generate a new key. The old key ceases to function immediately, preventing any further usage with the compromised credential. No manual toggle is required.

There is no expiration date for keys unless you choose to rotate them. Balance and usage data persist regardless of key changes.

First Request with cURL

Sound wave illustration for: First Request with cURL

Generate voice files for your smart home assistant with a single HTTP POST. Send text to the speech endpoint and receive an audio file directly. This method requires no external SDKs and works with any tool that supports standard HTTP requests.

The API accepts JSON bodies containing the text to synthesize, the desired voice model, and output format. You must include your authentication key in the header to validate the request and ensure usage is tracked against your account balance.

Basic POST Request

Send a POST request to the /v1/audio/speech endpoint. Include your Bearer token in the Authorization header and a JSON body with the text payload. The service returns the audio file directly in the response body.

This approach is ideal for no-code platforms or simple scripts that trigger voice notifications when a sensor event occurs. The endpoint returns a single audio file; you must split texts longer than 4096 characters and join the files yourself.

  • Endpoint: POST https://api.atk777apk.com/v1/audio/speech
  • Auth: Authorization: Bearer tts-...
  • Body: JSON with model, input, voice, response_format

Required Fields

Every request must specify the model (tts-1 or tts-1-hd), the input text (max 4096 characters), and the voice preset. You must also define the response_format to determine the output file type.

The language field is optional but recommended for non-English Latin text to ensure correct pronunciation. If omitted, the system guesses the language, defaulting to English for Latin scripts.

  • model: tts-1 or tts-1-hd
  • input: string, max 4096 chars
  • voice: one of 8 presets
  • response_format: mp3, wav, opus, flac, or pcm

Response Format

A successful request returns an HTTP 200 status with the audio file as the response body. The file format matches the response_format parameter you specified in the request.

If the synthesis fails, the API returns an error code and the charge is refunded automatically. Check the response headers for metadata regarding character count and processing time if needed for debugging.

  • Success: HTTP 200 with audio file
  • Failure: Error code + full refund
  • Format matches response_format parameter

OpenAI SDK Integration

Sound wave illustration for: OpenAI SDK Integration

Integrating Heara’s TTS API with the official OpenAI SDKs requires minimal configuration. The primary adjustment is updating the base_url to point to the Heara endpoint, allowing you to use familiar methods like client.audio.speech.create() without changing your existing code structure significantly.

This approach leverages the identical request shape of the OpenAI speech endpoint, ensuring that standard SDK behaviors for retries and error handling remain intact. You simply swap the API base URL and provide your Heara-specific Bearer token for authentication.

Setting base_url

Configure your SDK client’s base URL to https://api.atk777apk.com/v1. This directs all subsequent audio synthesis requests to the Heara infrastructure while maintaining compatibility with the standard OpenAI client interface.

Ensure your authentication header includes your unique Bearer token generated from the /get-api-key/ dashboard. The SDK will automatically attach this token to every request.

  • Base URL: https://api.atk777apk.com/v1
  • Auth Header: Authorization: Bearer tts-<your_key>
  • SDK Compatibility: OpenAI Python/Node.js libraries

Using Official SDKs

Use the standard OpenAI SDKs for Python or Node.js. No custom client wrapper is needed because the API endpoint follows the same JSON schema as the OpenAI speech endpoint.

This allows you to continue using established patterns for managing API keys and environment variables, reducing the learning curve for developers already familiar with OpenAI’s ecosystem.

Code Examples

```python import os from openai import OpenAI client = OpenAI( base_url="https://api.atk777apk.com/v1", api_key=os.getenv("HEARA_API_KEY") ) with client.audio.speech.create( model="tts-1", voice="nova", input="Kitchen lights activated.", response_format="mp3" ) as response: response.stream_to_file("output.mp3") `` Replace os.getenv("HEARA_API_KEY") with your actual key. The create()` method returns the complete audio file; the API does not support streaming audio chunks.

Request Parameters

Sound wave illustration for: Request Parameters

The API accepts two model identifiers that route to the same underlying synthesis engine. Both tts-1 and tts-1-hd deliver identical audio quality and pricing, allowing you to switch versions without changing your billing structure. You specify the model in the JSON body to define the synthesis pipeline.

Voice selection determines the timbre and delivery style of the generated audio. The eight presets range from warm narrators to energetic promo voices, all capable of speaking any supported language. Selecting the right voice ensures your smart home notifications or voice assistant responses match the intended context.

Model Selection

Use tts-1 or tts-1-hd in the model field. Both utilize the same engine and carry the same cost per character. There is no performance difference between them, so you can standardize on tts-1 for simplicity in your IoT firmware.

Voice Presets

Select from eight distinct voice profiles. Female voices include aria (warm narrator), nova (upbeat), luna (storytelling), and sage (instructional). Male options are felix (energetic), milo (conversational), atlas (neutral news), and orion (deep documentary). Each voice supports all 23 listed languages.

Voices are based on licensed recordings from LibriTTS-R and LibriVox. Every generated audio file contains an inaudible watermark identifying it as synthetic speech, which is useful for compliance in automated announcements.

  • aria: warm, clear narrator
  • nova: bright, upbeat
  • luna: soft, storytelling
  • sage: calm, instructional
  • felix: energetic, promo
  • milo: friendly, conversational
  • atlas: neutral, news
  • orion: deep, documentary

Speed and Language

Adjust playback speed using the speed parameter, accepting values between 0.25 and 4.0. This allows you to slow down complex instructions or speed up simple status updates. The default speed is 1.0.

Specify the language using an ISO code to ensure accurate synthesis, especially for Latin-script texts that might otherwise default to English. If omitted, the system guesses the language from the script, which may lead to errors for non-English Latin texts like German or Dutch.

Response Formats

Sound wave illustration for: Response Formats

Select your preferred audio format via the response_format parameter. MP3 is the default choice for most voice assistant integrations due to its balanced compression and universal player support.

MP3 Support

MP3 provides efficient file sizes suitable for network transmission in smart home devices. It ensures compatibility with standard audio players and streaming protocols used in IoT ecosystems.

WAV and OPUS Options

Choose WAV for lossless, uncompressed audio quality, ideal for local storage or high-fidelity playback. OPUS offers superior compression for low-bandwidth connections, maintaining clarity while reducing data usage for voice notifications.

FLAC and PCM

FLAC provides lossless compression, preserving exact audio data without the overhead of uncompressed WAV. PCM returns raw, uncompressed digital audio samples, useful for direct hardware interfacing or further signal processing.

Response Formats

Error Handling

Sound wave illustration for: Error Handling

When synthesis fails, the API returns a standard HTTP error code and returns the character charge in full. Common issues include invalid model names, unsupported voice IDs, or text exceeding the 4096-character limit per request.

Common HTTP Errors

400 Bad Request indicates malformed JSON or missing required fields. 401 Unauthorized occurs if the Bearer token is missing or invalid. 422 Unprocessable Entity signals that the input text exceeds length limits.

  • 400: Invalid JSON structure
  • 401: Missing or invalid API key
  • 422: Text exceeds 4096 characters

Rate Limit Errors

A 429 status code appears when you exceed 60 requests per minute (or 10 RPM before your first top-up). The response includes a Retry-After header indicating when to resume.

  • 429: Too Many Requests
  • Retry-After header provides wait time

Retry Logic

Implement exponential backoff for 429 errors. For 500-level server errors, retry up to three times with increasing delays. Since requests are processed sequentially, brief pauses help avoid queue congestion during high load.

Rate Limits

Sound wave illustration for: Rate Limits

The API enforces a standard limit of 60 requests per minute per active key. This ceiling ensures stable synthesis performance for your smart home automations and voice assistant triggers. If you exceed this threshold, subsequent requests will be queued or rejected until the window resets.

Under sustained load, requests are processed sequentially. Longer texts may experience slight delays as the system synthesizes audio in real-time chunks. Monitoring your usage dashboard helps you adjust automation frequencies to stay within these bounds without interrupting user experiences.

60 Requests Per Minute

Your active key allows up to 60 synthesis requests every 60 seconds. This limit applies uniformly across all models and voices. Exceeding this rate results in a 429 Too Many Requests error. Implement exponential backoff in your no-code workflows to handle temporary throttling gracefully.

  • Limit is per API key, not per account.
  • Requests are processed sequentially under load.
  • Exceeding the limit returns a 429 status code.

Initial Limit of 10 RPM

New accounts start with a reduced limit of 10 requests per minute. This lower threshold prevents abuse during the free trial phase. Once you top up your balance, the limit automatically increases to the standard 60 RPM. This change happens within minutes of a successful transfer.

  • Starts at 10 RPM for new keys.
  • Increases to 60 RPM after top-up.
  • No manual verification required for limit increase.

Increasing Limits with Top-Up

Adding funds via USDT (TRC-20) on the TRON network elevates your rate limit. There is no need to contact support or wait for manual review. Your balance does not expire, and the higher throughput remains active as long as your key is valid. This ensures consistent performance for your IoT devices.

  • Top-up via USDT (TRC-20) only.
  • Minimum top-up amount is $5.
  • Limits increase automatically within minutes.

Voices and Languages Endpoint

Sound wave illustration for: Voices and Languages Endpoint

The API provides two endpoints for retrieving metadata about supported voices and models. Use GET /v1/voices to list available presets, languages, and formats. Use GET /v1/models to confirm the current model versions.

GET /v1/voices

Returns a JSON list of all 8 voice presets (aria, nova, luna, sage, felix, milo, atlas, orion) along with their associated languages and supported output formats. This helps you map specific voice IDs to your smart home device profiles.

GET /v1/models

Returns the available model IDs, typically "tts-1" and "tts-1-hd". Both models use the same engine and pricing structure.

Available Options

Voices support 23 languages including English, German, Spanish, and Japanese. Any voice can speak any supported language. If the language field is omitted, the system guesses the language from the script, defaulting to English for Latin text.

  • 8 Voice Presets
  • 23 Supported Languages
  • Auto-language detection

Listen to the 8 voices

Each sample below was generated by this API from the same sentence. The voice carries a natural rhythm that mimics human narration, ideal for reading out longer text inputs or ambient updates.

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. openai-python on GitHub
  3. IETF RFC 7845: Ogg Opus
  4. openai-node on GitHub
  5. LibriTTS-R corpus (OpenSLR 141)
  6. OpenAI API reference: create speech
  7. curl documentation
  8. MDN: Web Speech API
  9. LibriTTS-R paper (arXiv 2305.18802)
  10. W3C WAI: making audio and video accessible
  11. Python documentation
  12. LibriVox public-domain audiobooks

More on this site