ASR Quickstart
This guide makes your first transcription against Shisa ASR. You will need an API key — create one in the Shisa platform. New accounts include $10 in free credits.
1. Get your API key
Sign up for a Shisa AI account and obtain your API key from the Shisa platform. Include it in the Authorization header with the shsk: prefix:
Authorization: Bearer YOUR_API_KEY
Shisa API keys start with shsk:. Pass the full key — including the shsk: prefix — in the Authorization: Bearer YOUR_API_KEY header. A missing or malformed token returns a 401 error.
Keep your API key out of source control. Read it from an environment variable (for example SHISA_API_KEY) in real applications.
2. Prepare your audio
The API accepts base64-encoded audio in WAV, OGG, MP3, or FLAC. Encode any supported file to base64 first:
base64 -w0 audio.ogg # Linux
base64 -i audio.ogg # macOS
3. Make a request
Send a POST request to the endpoint with your base64-encoded audio in the audio field.
curl
curl -s -XPOST 'https://api.shisa.ai/asr/srt/audio_llm' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"audio": "'$(base64 -w0 audio.ogg)'"
}'
Python
import base64
import requests
# Read and encode audio file
with open("audio.ogg", "rb") as f:
audio_data = base64.b64encode(f.read()).decode("utf-8")
url = "https://api.shisa.ai/asr/srt/audio_llm"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {
"audio": audio_data
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
async function transcribeAudio(audioFile) {
// Read file and convert to base64
const fileBuffer = await audioFile.arrayBuffer();
const base64Audio = btoa(
new Uint8Array(fileBuffer).reduce(
(data, byte) => data + String.fromCharCode(byte),
''
)
);
const response = await fetch('https://api.shisa.ai/asr/srt/audio_llm', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
audio: base64Audio
})
});
if (!response.ok) {
throw new Error(`API request failed: ${response.status}`);
}
return await response.json();
}
// Example usage with file input
document.querySelector('#audioInput').addEventListener('change', async (e) => {
const file = e.target.files[0];
if (file) {
const result = await transcribeAudio(file);
console.log('Transcription:', result);
}
});
Only the audio field is required. Language is auto-detected and tuning parameters use sensible defaults. To target a specific language or add domain terms, see the API reference.
4. Read the response
The API returns a JSON response with the transcribed text, the detected language, and a confidence score:
{
"text": "こんにちは、シサAIです。",
"language": "ja",
"confidence": 0.98
}
Next steps
- See every request parameter and error code in the API reference.
- Review supported formats and the 97 detectable languages in Audio & languages.
- Learn the auth header conventions across services in Authentication.