API reference

Every endpoint, parameter and response in the Baian Partner API, read from the OpenAPI file.

Baian Partner API 1.4.0

Base URL: https://api.baian.ai/v1

Live transcription of one source audio feed per session (one teacher microphone), with optional translation and Quran reference detection. Hadith reference detection is opt-in where this environment supports it. Create a session from your server and give the returned source token to the teacher app, which publishes one microphone track to LiveKit. Read results by long-polling the events endpoint and send them on to your students yourself. Session data is private to your organization.

Lifecycle: a session moves from created to live when Baian processes its first source audio, to ending when a stop is requested, and then to ended. It can also finish as failed (it could not start) or expired.

Timing: a created session that records no results expires after 600 seconds. A live session that receives no new source audio for 300 seconds stops with end_reason source_lost. A session stops once it has processed max_session_seconds of audio (end_reason max_duration).

After a stop, Baian finishes processing the remaining audio. If that is not confirmed within 120 seconds, the session ends with completeness incomplete. If an allowance, duration or access limit stopped the session, end_reason keeps that reason; otherwise end_reason is agent_lost.

end_reason says why the session stopped. completeness and detail say whether results are missing and why. The two are independent: a session stopped normally (end_reason stopped) can still be incomplete if processing failed while it was finishing. If Baian ends a session itself without a stop request, end_reason is source_lost. When results are missing, the detail field of the session.ended event holds a reason code, for example source_provider_stalled or source_connection_closed (the teacher audio could not be transcribed), control_unavailable or heartbeat_503 (Baian lost contact with its own control service), retries_exhausted or queue_capacity_reached (not all results could be saved), or close_timeout. detail is open diagnostic text, not an enum, and new codes may appear.

Access: after you revoke an API key, every later request made with it returns 401. Sessions it created keep running; stop or read them with another key from the same organization or from the dashboard. A source token that was already issued can still be used to join until its expires_at (15 minutes after it was issued). If the organization is suspended, or the dashboard user who started a console session loses owner or admin access, running sessions stop within about 10 seconds and finish with end_reason access_revoked. If processing for a session is not running, this can take up to about 3 minutes. While the organization is suspended, every API key request returns 403 org_suspended. Reactivating the organization does not resume a stopped session.

Completeness: a session is complete only when every transcript segment has every requested translation, each requested reference check (quran_refs and hadith_refs) has a result other than failed, and no results were lost. Otherwise it is incomplete. missing_segment_ids lists the segments known to be missing results. It can be empty for an incomplete session when audio was lost before it became a segment, for example because transcription failed; detail then explains why.

Saved results in /events and /transcript contain only finished text. Baian sends each transcript.final segment once and never changes it. Its words come from speech recognition and can include words that were not yet confirmed when Baian committed the segment.

Reference events contain full snapshots. Later speech can produce another quran.references or hadith.references event for the same segment. Process events in seq order and replace that kind of reference list for segment_id. Keep the transcript text unchanged. Older results may omit reference_revision and reference_policy_version.

Hadith citations: when a hadith reference has citation.scheme print_edition, show the collection and citation.number, and name citation.edition where readers can find it. When citation is absent or null, show the collection and canonical_quote without a number. Older results can carry citation.scheme upstream_arabicnumber; treat that number as unverified. Never show record_number as a hadith number.

session.gap is sent only when teacher audio resumes after the source reconnected or processing restarted. It covers the time with no processed audio. Silences and pauses within continuous audio do not create gap events.

Timeline: start_ms, end_ms, from_ms and to_ms are integer milliseconds since session.created (created_at), including setup time and gaps. source_seconds counts processed source audio only.

Pilot limits: each monthly period that Baian activates for your organization includes 2,000 minutes of source audio and 2,500 minutes of total session running time, shared by every API key and the console. Running time is measured with server timestamps and includes setup, pauses and the final processing after a stop. GET /usage shows the period dates and the seconds remaining. New sessions are refused when there is no active period or when either limit is used up. Each session ends at the end of the period it started in, when the audio limit is reached, or at most eight hours after it was created. Use an empty output_langs array for a transcript-only class. Your organization needs translation enabled only when you request an output language. When a usage or time limit is reached, Baian stops the session and still saves its final results. Running sessions check their limits about every 10 seconds, with a backup check every minute, so concurrent sessions and final processing can use slightly more than the remaining seconds last reported. All audio used is still recorded, and overages are not charged automatically. Contact Baian to renew or add usage.

Retention: data for an ended session (events, transcript, metadata and the external class identifier) is deleted after your organization's retention period (retention_days, 30 days by default) or when you delete the session. For usage and safe retries, Baian retains the internal session and organization IDs, key ID for API-created sessions, status, timestamps, completeness, audio duration, original Idempotency-Key and request hash. Keep personal or sensitive data out of idempotency keys.

Delivery: poll GET /sessions/{id}/events for saved results. To show words as they are spoken, also open GET /sessions/{id}/partials. The preview stream has no cursor or history. There are no webhooks. Budget 600 requests per minute per API key. Cloudflare applies the limit approximately at each location. On 429 rate_limited, wait for the duration in Retry-After.

Authentication

Send Authorization: Bearer bn_live_… to authenticated endpoints (http bearer).

Organization API key (bn_live_...). Keep it on your server and never include it in browser or mobile app code.

The public OpenAPI file is available without a key.

Endpoints

Languages and usage

Supported languages

get /languages

Responses

StatusDescriptionBody
200LanguagesHeaders: X-Request-IdLanguages
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/languages" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Current organisation audio allowance

get /usage

Scope sessions:read. All API keys and console sessions share this allowance.

Responses

StatusDescriptionBody
200AllowanceHeaders: X-Request-Idobject
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/usage" \
  -H "Authorization: Bearer $BAIAN_API_KEY"
Sessions

Create a session

post /sessions

Scope sessions:write. Idempotent: sending the same Idempotency-Key with the same body returns the same session (200 with Idempotent-Replayed: true). Inspect session.status and source before connecting the microphone. A new session can return 201 with status failed, failure_code provisioning_failed and source set to null.

Parameters

FieldInTypeDescription
Idempotency-Keyrequiredheaderstring1 to 200 characters

Request body (CreateSession)

FieldTypeDescription
external_session_idrequiredstringYour own identifier, for example a class ID. Only one open session can use a given value.1 to 200 characters
input_langrequiredstringMain spoken language (see /languages).
additional_input_langsoptionalstring[] | nullOther spoken languages. Use ["ar"] for English teaching with Arabic quotations. Omit or send null for none. After normalization, duplicates and the main language are removed. Up to 3 additional languages may remain.
output_langsoptionalstring[] | nullTranslation targets. Omit, send null or leave empty for a transcript only. Up to 5 distinct supported languages after normalization.
quran_refsoptionalbooleanDetect Quran quotations in Arabic-script source text, whatever the main language.Default: true
hadith_refsoptionalbooleanMatch Arabic hadith quotations against a fixed version of the six-book corpus. For new sessions, request this only when /languages features.hadith_refs is true. Returns 503 feature_unavailable if disabled in this environment or 403 hadith_not_enabled if disabled for your organization. A match says nothing about authenticity or grading.Default: false
metadataoptionalobject | nullUp to 4 KB. Omission or null stores an empty object. Deleted with the class content.

Responses

StatusDescriptionBody
200Idempotent replayHeaders: X-Request-Id, Idempotent-ReplayedCreateSessionResponse
201Session created. Check its status before connecting.Headers: X-Request-IdCreateSessionResponse
400Error. error.code is one of: validation_failed, idempotency_key_requiredHeaders: X-Request-IdError
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspended, usage_period_required, usage_limit_reached, runtime_limit_reached, translation_not_enabled, hadith_not_enabledHeaders: X-Request-IdError
409Error. error.code is one of: idempotency_conflict, session_already_activeHeaders: X-Request-IdError
410Error. error.code is one of: session_deletedHeaders: X-Request-IdError
413Error. error.code is one of: payload_too_largeHeaders: X-Request-IdError
429For rate_limited, wait at least Retry-After seconds. For concurrency_limit, wait for an active session to finish.Headers: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailable, feature_unavailableHeaders: X-Request-IdError
Example request
curl -X POST "https://api.baian.ai/v1/sessions" \
  -H "Authorization: Bearer $BAIAN_API_KEY" \
  -H "Idempotency-Key: <idempotency-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "external_session_id": "class-2026-11-02-fiqh-101",
    "input_lang": "en",
    "additional_input_langs": [
      "ar"
    ],
    "output_langs": [],
    "quran_refs": true,
    "hadith_refs": false,
    "metadata": {}
  }'

List sessions (newest first)

get /sessions

Scope sessions:read. Deleted sessions are omitted.

Parameters

FieldInTypeDescription
statusoptionalqueryStatus
external_session_idoptionalquerystring
limitoptionalqueryinteger1 to 100Default: 25
cursoroptionalquerystringnext_cursor from the previous page.

Responses

StatusDescriptionBody
200PageHeaders: X-Request-IdSessionPage
400Error. error.code is one of: validation_failedHeaders: X-Request-IdError
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/sessions" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Get a session

get /sessions/{id}

Scope sessions:read.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
200SessionHeaders: X-Request-IdSessionEnvelope
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/sessions/$ID" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Delete an ended session

delete /sessions/{id}

Scope sessions:write. Removes events, transcript, references, metadata and the external class identifier. The internal usage and retry record described under Retention remains. After deletion the session returns 404, and a create request with the same Idempotency-Key returns 410 session_deleted.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
200DeletedHeaders: X-Request-IdDeleted
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
409Error. error.code is one of: session_not_ended, cleanup_pendingHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl -X DELETE "https://api.baian.ai/v1/sessions/$ID" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Stop a session

post /sessions/{id}/stop

Scope sessions:write. Idempotent. The session usually moves to ending while Baian finishes the remaining audio, then to ended. If dispatch has started, a session can still be ending before audio arrives. If dispatch has not started, Stop ends it immediately. Keep polling events until terminal is true.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
202Stopping or already terminalHeaders: X-Request-IdSessionEnvelope
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl -X POST "https://api.baian.ai/v1/sessions/$ID/stop" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Stream the current source transcript preview

get /sessions/{id}/partials

Scope events:read. Connect from your server, keeping the API key private. Each transcript.partial event replaces the current preview. Its data contains segment_id, language, text, and revision. An empty text clears that segment. Replace the preview when transcript.final with the same segment_id arrives from /events. Ignore previews for a segment already finalized. Reopen the stream after an ordinary close (up to 25 seconds per connection). A new connection receives the current preview if available. Previews can be dropped and are never included in /transcript or the event cursor.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
200Server-sent events with provisional source text.—
204Class ended. Keep reading /events until terminal is true.—
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
429Error. error.code is one of: rate_limited, too_many_readersHeaders: X-Request-IdError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailable, feature_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/sessions/$ID/partials" \
  -H "Authorization: Bearer $BAIAN_API_KEY"
Teacher audio

Issue a new source (microphone) token

post /sessions/{id}/source-token

Scope sessions:write. Use this to reconnect the teacher. Available only while the session is created or live.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
200TokenHeaders: X-Request-IdSourceEnvelope
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
409Error. error.code is one of: session_not_activeHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl -X POST "https://api.baian.ai/v1/sessions/$ID/source-token" \
  -H "Authorization: Bearer $BAIAN_API_KEY"
Results

Read events (replayable, long-poll)

get /sessions/{id}/events

Scope events:read. Returns events with seq greater than after, in order. With wait above 0, the request waits up to wait seconds for at least one event or for the session to finish. Save next_after and pass it as after on the next request. terminal becomes true once the session is ended, failed or expired and every event has been returned.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)
afteroptionalqueryinteger0 to 9007199254740991Default: 0
limitoptionalqueryinteger1 to 500Default: 100
waitoptionalqueryinteger0 to 25Default: 0

Responses

StatusDescriptionBody
200EventsHeaders: X-Request-IdEventPage
400Error. error.code is one of: validation_failedHeaders: X-Request-IdError
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/sessions/$ID/events" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Assembled transcript

get /sessions/{id}/transcript

Scope sessions:read.

Parameters

FieldInTypeDescription
idrequiredpathstring (uuid)

Responses

StatusDescriptionBody
200TranscriptHeaders: X-Request-IdTranscript
401Error. error.code is one of: unauthorizedHeaders: X-Request-IdError
403Error. error.code is one of: scope_forbidden, org_suspendedHeaders: X-Request-IdError
404Error. error.code is one of: not_foundHeaders: X-Request-IdError
429Error. error.code is one of: rate_limitedHeaders: X-Request-Id, Retry-AfterError
500Error. error.code is one of: internal_errorHeaders: X-Request-IdError
503Error. error.code is one of: partner_api_disabled, rate_limiter_unavailableHeaders: X-Request-IdError
Example request
curl "https://api.baian.ai/v1/sessions/$ID/transcript" \
  -H "Authorization: Bearer $BAIAN_API_KEY"

Schemas

Common

Error

FieldTypeDescription
errorrequiredobject
error.coderequiredstringStable machine-readable code.
error.messagerequiredstring
error.request_idrequiredstring
error.session_idoptionalstringIncluded with session_already_active errors.

Status

stringValues: "created", "live", "ending", "ended", "failed", "expired"

Languages

FieldTypeDescription
inputrequiredobject[]
input[].coderequiredstring
input[].namerequiredstring
outputrequiredobject[]
output[].coderequiredstring
output[].namerequiredstring
output[].text_onlyrequiredbooleanText output only (no speech).
limitsrequiredobject
limits.max_output_langsoptional5
limits.max_additional_input_langsoptional3
featuresoptionalobject
features.hadith_refsoptionalbooleanWhether your organization can request hadith_refs=true in this environment.
notesrequiredobject

Allowance

FieldTypeDescription
starts_atrequiredstring (date-time)
ends_atrequiredstring (date-time)
allowance_secondsrequirednumber
source_secondsrequirednumber
remaining_secondsrequirednumberat least 0
runtime_allowance_secondsoptionalnumber
runtime_secondsoptionalnumber
runtime_remaining_secondsoptionalnumberat least 0
activerequiredboolean
Sessions

CreateSession

FieldTypeDescription
external_session_idrequiredstringYour own identifier, for example a class ID. Only one open session can use a given value.1 to 200 characters
input_langrequiredstringMain spoken language (see /languages).
additional_input_langsoptionalstring[] | nullOther spoken languages. Use ["ar"] for English teaching with Arabic quotations. Omit or send null for none. After normalization, duplicates and the main language are removed. Up to 3 additional languages may remain.
output_langsoptionalstring[] | nullTranslation targets. Omit, send null or leave empty for a transcript only. Up to 5 distinct supported languages after normalization.
quran_refsoptionalbooleanDetect Quran quotations in Arabic-script source text, whatever the main language.Default: true
hadith_refsoptionalbooleanMatch Arabic hadith quotations against a fixed version of the six-book corpus. For new sessions, request this only when /languages features.hadith_refs is true. Returns 503 feature_unavailable if disabled in this environment or 403 hadith_not_enabled if disabled for your organization. A match says nothing about authenticity or grading.Default: false
metadataoptionalobject | nullUp to 4 KB. Omission or null stores an empty object. Deleted with the class content.

Source

FieldTypeDescription
livekit_urlrequiredstring
tokenrequiredstringLiveKit token. Use it to join the room and publish one microphone track only. It must be used to join within 15 minutes.
identityrequiredstring
expires_atrequiredstring (date-time)

SourceEnvelope

FieldTypeDescription
sourcerequiredSource

CreateSessionResponse

FieldTypeDescription
sessionrequiredSession
sourcerequiredSource | null

SessionEnvelope

FieldTypeDescription
sessionrequiredSession

SessionPage

FieldTypeDescription
sessionsrequiredSession[]
next_cursorrequiredstring | null

Deleted

FieldTypeDescription
deletedrequiredtrue
idrequiredstring (uuid)

Session

FieldTypeDescription
idrequiredstring (uuid)
external_session_idrequiredstring
statusrequiredStatusValues: "created", "live", "ending", "ended", "failed", "expired"
input_langrequiredstring
additional_input_langsoptionalstring[]
output_langsrequiredstring[]
quran_refsrequiredboolean
hadith_refsoptionalbooleanDefault: false
metadataoptionalobject
created_atrequiredstring (date-time)
media_ready_atoptionalstring (date-time) | null
last_audio_atoptionalstring (date-time) | null
stop_requested_atoptionalstring (date-time) | null
ended_atoptionalstring (date-time) | null
end_reasonoptionalstring | nullValues: "stopped", "source_lost", "max_duration", "expired", "agent_lost", "failed", "access_revoked", "usage_limit", "runtime_limit", "usage_period_ended", "translation_disabled"
completenessoptionalstring | nullValues: "complete", "incomplete"
missing_segment_idsoptionalstring[]
failure_codeoptionalstring | nullValues: "provisioning_failed", "provisioning_abandoned"
source_secondsrequirednumberProcessed source audio seconds (excludes setup and gaps).
max_session_secondsoptionalinteger
max_elapsed_secondsoptionalintegerMaximum elapsed time from created_at, including setup and pauses.
stop_reasonoptionalstring | null
last_event_seqrequiredinteger
created_viaoptionalstringValues: "api_key", "console"
created_by_key_prefixoptionalstring | null
Results and events

QuranReference

FieldTypeDescription
refrequiredstring"S:A" or "S:A-B", consistent with surah/ayah fields.
surahrequiredinteger1 to 114
ayah_startrequiredintegerat least 1
ayah_endrequiredintegerat least 1
matched_textoptionalstring
raw_spanoptionalinteger[]Offsets in the final source text of this segment. Start is inclusive and end is exclusive. Count Unicode code points from zero, including vowel marks. In JavaScript, use Array.from(text).slice(start, end).join(''). Highlight only when 0 ≤ start < end ≤ the segment length in code points and the selected text equals matched_text. If the range is absent and the words appear twice, show the reference without a highlight.at most 2 items

TranscriptFinal

A segment Baian has committed. It is sent once and never changed. Its words come from speech recognition and can include words that were not yet confirmed when it was committed.

FieldTypeDescription
segment_idrequiredstring
textrequiredstring
languagerequiredstringThe session input_lang, even when the segment contains another language. For example, Arabic quotation text in an English class still has language en. Baian does not identify the language of each segment.
start_msoptionalinteger | null
end_msoptionalinteger | null

TranslationFinal

FieldTypeDescription
segment_idrequiredstring
languagerequiredstring
statusoptional"complete"
textrequiredstring

TranslationFailed

FieldTypeDescription
segment_idrequiredstring
languagerequiredstring
statusoptional"failed"
reasonoptionalstring | null

QuranReferences

Full Quran reference snapshot for one segment. Later events replace this list; order by the outer event seq.

FieldTypeDescription
reference_revisionoptionalintegerOptional snapshot revision, starting at zero when supported. Use the outer event seq for ordering and duplicate handling.0 to 9007199254740991
reference_policy_versionoptionalstringVersion of the reference memory and update policy, when supported. Separate from selector_version and corpus_version.1 to 128 characters
segment_idrequiredstring
statusrequiredstringaccepted includes at least one reference; other statuses include none. failed makes the session incomplete.Values: "accepted", "abstained", "failed", "no_candidates"
referencesrequiredQuranReference[]at most 50 items
reasonoptionalstring | null
selector_versionoptionalstring | null

HadithReference

FieldTypeDescription
record_idrequiredstringEdition-specific ID, for example ara-bukhari:1. Read it together with corpus_version. It is not a universal hadith number.
collectionrequiredstringValues: "bukhari", "muslim", "abudawud", "tirmidhi", "nasai", "ibnmajah"
editionrequiredstringNamed source edition, for example ara-muslim.
record_numberrequiredstringRecord number in the source dataset, which may differ from the usual citation number. In Muslim it is a running index. Do not display it as a hadith number. Use citation when it is present.at most 40 characters
citationoptionalobject | nullHadith number to display, when one was checked. Absent or null means no checked number exists for this record: show the collection and canonical_quote without a number.
Print edition citationBaian found this record's text in a digital transcription of the named print edition, and that edition gives it this number. It is not a check against printed pages, and it says nothing about authenticity or grading.
citation.numberrequiredstringNumber of this hadith in the named print edition.at most 40 characters
citation.schemerequired"print_edition"
citation.editionrequiredstringName of the print edition that gives this number.1 to 200 characters
citation.verificationrequired"edition_text_match"
Unverified dataset citationSent by older sessions. The number was copied from the source dataset and has not been checked against any edition. Treat it as unverified.
citation.numberrequiredstringAlternative number copied exactly from the source, including fractional variants. It has not been independently verified.at most 40 characters
citation.schemerequired"upstream_arabicnumber"
citation.verificationrequired"unverified"
matched_textrequiredstringExact substring of the raw transcript. It can contain speech recognition errors.1 to 5000 characters
canonical_quoterequiredstringExcerpt copied from the matching record in the fixed corpus. It is separate from the speech recognition text.1 to 10000 characters
match_typerequiredstringHow the match compares with the normalized transcript text. It does not prove the exact spoken wording or authenticity.Values: "verbatim", "near_verbatim", "fragment"
raw_spanoptionalinteger[]Offsets in the final source text of this segment. Start is inclusive and end is exclusive. Count Unicode code points from zero, including vowel marks. In JavaScript, use Array.from(text).slice(start, end).join(''). Highlight only when 0 ≤ start < end ≤ the segment length in code points and the selected text equals matched_text. If the range is absent and the words appear twice, show the reference without a highlight.at most 2 items

HadithReferences

Full hadith reference snapshot for one segment. Later events replace this list; order by the outer event seq.

FieldTypeDescription
reference_revisionoptionalintegerOptional snapshot revision, starting at zero when supported. Use the outer event seq for ordering and duplicate handling.0 to 9007199254740991
reference_policy_versionoptionalstringVersion of the reference memory and update policy, when supported. Separate from selector_version and corpus_version.1 to 128 characters
segment_idrequiredstring
statusrequiredstringOnly accepted includes references. If a session requested hadith matching, a failed or missing result makes it incomplete.Values: "accepted", "abstained", "failed", "no_candidates"
referencesrequiredHadithReference[]at most 20 items
reasonoptionalstring | null
selector_versionrequiredstring1 to 128 characters
corpus_versionrequiredstring | null

SessionGap

Sent when teacher audio resumes after the source reconnected or processing restarted. Not sent for pauses within continuous audio.

FieldTypeDescription
from_msrequiredinteger
to_msrequiredinteger
reasonoptionalstring | null

SessionTerminal

FieldTypeDescription
statusrequiredstringValues: "ended", "failed", "expired"
reasonrequiredstringValues: "stopped", "source_lost", "max_duration", "expired", "agent_lost", "failed", "access_revoked", "usage_limit", "runtime_limit", "usage_period_ended", "translation_disabled"
completenessrequiredstringValues: "complete", "incomplete"
missing_segment_idsrequiredstring[]
unacked_event_countoptionalinteger
detailoptionalstring | null
codeoptionalstringOnly on session.failed.
source_secondsrequirednumber

Event

FieldTypeDescription
idrequiredstringevt_<session_id>_<seq>
seqrequiredintegerat least 1
typerequiredstringValues: "session.created", "session.live", "transcript.final", "translation.final", "translation.failed", "quran.references", "hadith.references", "session.gap", "session.ended", "session.failed"
session_idrequiredstring (uuid)
external_session_idrequiredstring
created_atrequiredstring (date-time)
datarequiredobjectShape depends on type.

One of:

  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object

EventPage

FieldTypeDescription
eventsrequiredEvent[]
next_afterrequiredinteger
session_statusrequiredStatusValues: "created", "live", "ending", "ended", "failed", "expired"
terminalrequiredboolean

TranscriptSegment

FieldTypeDescription
segment_idrequiredstring
textoptionalstring | null
languageoptionalstring | null
start_msoptionalinteger | null
end_msoptionalinteger | null
translationsrequiredobject
translation_failuresrequiredobject[]
translation_failures[].languagerequiredstring
translation_failures[].reasonoptionalstring | null
quran_statusoptionalstring | nullValues: "accepted", "abstained", "failed", "no_candidates"
quran_reasonoptionalstring | null
quran_referencesrequiredQuranReference[]
selector_versionoptionalstring | null
hadith_statusoptionalstring | nullValues: "accepted", "abstained", "failed", "no_candidates"
hadith_reasonoptionalstring | null
hadith_referencesoptionalHadithReference[]
hadith_selector_versionoptionalstring | null
hadith_corpus_versionoptionalstring | null

Transcript

FieldTypeDescription
session_idrequiredstring
external_session_idrequiredstring
statusrequiredStatusValues: "created", "live", "ending", "ended", "failed", "expired"
completenessrequiredstring | nullValues: "complete", "incomplete"
missing_segment_idsrequiredstring[]
output_langsrequiredstring[]
segmentsrequiredTranscriptSegment[]