Skip to main content

ASR API Reference

The Shisa ASR API transcribes base64-encoded audio into text with a single JSON request. This page documents the endpoint, its request parameters, the success response, and error handling.

Endpoint

POST https://api.shisa.ai/asr/srt/audio_llm

Authenticate with a bearer token containing your full shsk: API key:

Authorization: Bearer YOUR_API_KEY

The request body is JSON and the server auto-detects the audio format from its binary header.

Request parameters

ParameterTypeRequiredDescription
audiostringRequiredBase64-encoded audio data (WAV, OGG, MP3, or FLAC).
languagestringOptionalLanguage code (e.g. "ja", "en"). Omit for automatic language detection (LID).
hotwordsstring[]OptionalArray of words/phrases to boost recognition accuracy for domain-specific terms.
temperaturefloatOptionalSampling temperature. Lower values make output more deterministic. Default: 0.0.
top_pfloatOptionalNucleus sampling parameter. Controls diversity of output. Default: 0.85.
frequency_penaltyfloatOptionalPenalizes frequent tokens to reduce repetition. Default: 0.5.
repetition_penaltyfloatOptionalPenalizes token repetition; values above 1.0 discourage repetition. Default: 1.05.
vadinteger or stringOptionalVoice activity detection: 0/"off" (default), 1/"on", or "segments" for timestamped chunks.
min_silence_gapintegerSegments onlySilence in milliseconds that creates a split. Default: 400.
segment_paddingintegerSegments onlyPadding added to segment edges in milliseconds. Default: 100; range: 05000.
initial_segment_padding_msintegerSegments onlyLeading pre-roll for the first segment in milliseconds. Default: 1500; range: 05000.
speech_pad_msintegerSegments onlySpeech timestamp padding in milliseconds. Default: 200.
min_segment_durationfloatSegments onlyMinimum segment duration before merging, in seconds. Default: 1.5.
note

Only audio is required. With the recommended top-level audio request shape, language is auto-detected and vad defaults to "off". The field is named vad; vad_filter is not supported.

Legacy request shape

Legacy requests using messages default vad to 1. Their OpenAI-style model field is accepted for compatibility but ignored; the deployment selects the ASR backend and model.

Success response

A successful request returns a JSON object with the transcription, the detected or specified language, and a confidence score:

{
"text": "こんにちは、シサAIです。",
"language": "ja",
"confidence": 0.98
}
FieldDescription
textThe transcribed text from the audio.
languageThe detected or specified language code.
confidenceTranscription confidence score, from 0 to 1.

Segments response

With vad: "segments", the response contains timestamped chunks instead of a top-level text field:

{
"language": "ja",
"confidence": 1.0,
"segments": [
{
"start": 0.0,
"end": 4.78,
"text": "こんにちは、シサAIです。"
}
]
}

segments[].start and segments[].end are the emitted audio-chunk boundaries in seconds after padding and merging.

Error handling

Router-generated errors commonly include context, a numeric code, a name, and an error string:

{
"context": ["authMiddleware"],
"code": 104,
"name": "ErrAuthenticationFailed",
"error": "Authentication error: Invalid token"
}

Error codes

StatusCause
400Invalid JSON, base64/audio, language, VAD settings, or session ID. Most ASR body validation is backend-defined.
401Missing or invalid API key.
403The key is valid but does not have batch-ASR access.
404The routed ASR service/provider is not registered.
429Global key limit, ASR-specific limit, or backend capacity reached. Retry with backoff.
500Router-side internal or post-processing failure.
502The router could not reach the selected backend.
Backend statusBackend errors are forwarded with the backend's status and response body.

Exact backend error fields and messages are not part of the router contract. See Errors for robust error parsing.

Next steps