Sawalni API
APIsExamplesDocumentationOpen portal ↗
Omneity Labs API collection ↗Integration quickstart →API keys and playgrounds →
Apps

Batbot · Chatbots

Batbot turns a short creator prompt and an optional Khizana into a protected assistant for a standalone page or drop-in website widget. Text chat is always available. Daktilo voice input and ASAT spoken replies form separate, owner-billed capabilities.

Spoken-reply modes

Choose one mode while creating or updating a Batbot:

ModeBehaviorASAT usage
Text onlyNo Listen control and no speech generationNone
Play on demandA visitor presses Listen on an assistant replyGenerated only after the first press
Play automaticallyBatbot requests speech after every successful assistant replyGenerated for each reply

Autoplay is best-effort because browsers may block sound. When that happens, the generated reply remains available through the same Listen control. Batbot never automatically speaks its welcome message.

Choose either the default male or female ASAT voice. ASAT is optimized for Moroccan Darija and Arabic. Its normal language-identification and Rescript preprocessing applies to other supported scripts.

Creator API configuration

The optional speech object is accepted when creating or patching a chatbot:

json
{ "speech": { "mode": "on_demand", "voice": "female" } }

mode accepts off, on_demand, or autoplay. voice accepts male or female. Existing Batbots default to off, so this release does not introduce unexpected audio or charges.

Secure synthesis flow

When spoken replies are enabled, a successful Batbot chat response includes a short-lived speech token bound to that exact answer and Batbot. The public speech route requires both the existing widget session and this answer token. Tokens are single-use for generation, rate-limited by Batbot, domain, and client address, and cannot be changed to synthesize arbitrary owner-billed text.

The browser caches the returned audio for replay during the current conversation. Replaying cached audio does not call ASAT again. Audio responses use private, no-store and are never added to Khizana.

Billing

  • Sawalni chat completion is billed for every generated text answer.
  • Attached Khizana retrieval bills its Madmon and Sawtone query encodings.
  • Daktilo voice input is billed separately when a visitor transcribes a recording.
  • ASAT is billed to the Batbot owner by generated audio duration.
  • Play on demand avoids ASAT usage for replies nobody listens to; Play automatically can synthesize every successful reply.

All calls use the encrypted credential created for the Batbot or its attached Khizana and appear in the existing usage and billing ledger.

Widget behavior

The Batbot loader grants its iframe microphone and autoplay capabilities, follows the host page language and direction, and never exposes the owner API key. Allowed-domain checks still apply before an embedded widget session is issued.