Skip to main content

Introduction

The LangShazam API provides real-time spoken language detection through a WebSocket-based service. Send audio data and receive language identification results powered by OpenAI’s Whisper model.

Base URL

The production API is deployed on AWS Kubernetes:
wss://3.149.10.154.nip.io/ws
The frontend automatically connects to this endpoint via the ServerDiscovery service. See Server Configuration for alternative deployment endpoints.

Authentication

No authentication is required for the WebSocket endpoints. The service uses an internal OpenAI API key for processing audio data.

Core Endpoints

WebSocket Connection

Real-time audio streaming endpoint at /ws

Metrics

Server health and performance metrics at /metrics

Quick Start

const ws = new WebSocket('wss://3.149.10.154.nip.io/ws');

ws.onopen = () => {
  // Send audio data as binary
  ws.send(audioBuffer);
};

ws.onmessage = (event) => {
  const response = JSON.parse(event.data);
  console.log('Detected language:', response.data.language);
};

Response Format

All responses follow a standardized JSON format:
status
string
required
Response status: success or error
data
object
Result data when status is success
message
string
Error message when status is error
timestamp
string
required
ISO 8601 timestamp of the response
connection_id
string
required
Unique identifier for the connection (8-character UUID)

Rate Limits

The service supports a maximum of 3 concurrent OpenAI API calls. Additional requests are queued automatically.

CORS Configuration

The following origins are allowed:
  • https://www.langshazam.com
  • https://langshazam.com
  • http://localhost:3000
  • http://localhost:5173
  • http://127.0.0.1:3000
  • http://127.0.0.1:5173

Build docs developers (and LLMs) love