أساس · التوثيق
المنتجات

Text to Speech

Synthesize natural Arabic speech — voices, quality tiers, blocking, streaming, and realtime.

توليد الكلام

حوّل نصاً عربياً إلى صوت طبيعي، إمّا دفعة واحدة أو ببثّ متدفق يبدأ قبل اكتمال التوليد. تُحتسب الفوترة بعدد أحرف النص المُدخل.

ASAS TTS turns Arabic text into natural speech. You can get the whole clip in one response, stream it as chunked audio for low-latency playback, or drive it over a WebSocket for realtime apps.

Endpoints

EndpointShapeUse it for
POST /v1/ttsBlocking — returns the full audio clipShort, non-latency-sensitive synthesis
POST /v1/tts/streamChunked HTTP audioLow-latency playback (p90 first-audio < 150 ms)
WS /v1/tts/realtimeWebSocket protocolRealtime / interactive synthesis

All three take the same body.

Request

{
  "voice": "layan",
  "text": "أهلاً بك في أساس",
  "speed": 1.0,
  "quality": "standard"
}
FieldTypeNotes
textstringRequired. 1–500 characters. Longer input returns 422.
voicestringRequired. A voice slug from your org's voice registry.
speednumber0.52.0. Default 1.0.
qualityfast | standard | highDefault standard.

500-character limit. v1 accepts up to 500 characters per request. For longer text, split it into sentences and call in sequence. An Arabic-aware chunking pipeline that stitches the audio for you is a planned fast-follow (v1.1).

Quality tiers

quality trades latency for fidelity. It also sets the credit rate:

QualityRelative latencyTypical credit rate
fastLowest~0.5 credit / char
standardBalanced~1 credit / char
highHighest fidelity~1 credit / char

Exact rates are visible in your dashboard. Billing is always by input characters, counted before synthesis — a client abort mid-stream still bills the dispatched characters (the audio was already generated), and cached responses bill normally.

Blocking example

curl https://api.asas.flitc.tech/v1/tts \
  -H "Authorization: Bearer $ASAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "voice": "layan", "text": "أهلاً بك في أساس" }' \
  --output speech.wav

Streaming example

import { AsasClient } from "@asas/sdk";

const asas = new AsasClient({ apiKey: process.env.ASAS_API_KEY! });

const stream = await asas.tts.stream({
  voice: "layan",
  text: "مرحباً بك في منصة أساس للصوت العربي",
  quality: "fast",
});

// `stream` is a ReadableStream of audio chunks — pipe it to a player or a file.
for await (const chunk of stream) {
  process.stdout.write(chunk);
}

Voices

List the voices available to your organization from your registry (platform voices plus any of your own):

curl https://api.asas.flitc.tech/v1/voices \
  -H "Authorization: Bearer $ASAS_API_KEY"

Voice cloning is not enabled for customer keys at launch. When it ships it will be an entitlement with recorded consent and audit logging.

On this page