API Reference

API Reference

Complete HTTP endpoint reference for the ShunyaLabs platform. All endpoints accept multipart/form-data or JSON and use Bearer token authentication.


Choose a product


Base URLs

ServiceBase URL
Speech to Text (HTTP)https://asr.shunyalabs.ai
Speech to Text (WebSocket)wss://asr.shunyalabs.ai/ws
Text to Speech (HTTP)https://tts.shunyalabs.ai
Text to Speech (WebSocket)wss://tts.shunyalabs.ai/ws

Authentication

All endpoints except /health require a Bearer token in the Authorization header:

http
Authorization: Bearer <API_KEY>
Environment variable:
Set SHUNYALABS_API_KEY in your environment. The Python SDK reads it automatically โ€” no need to pass api_key= explicitly.

Common response shape

Successful responses always include "success": true. Error responses use standard HTTP status codes with a JSON body:

json
{
  "success": false,
  "error": {
    "code": "authentication_error",
    "message": "Missing or invalid API key."
  }
}