Skip to main content

Welcome to VoxNexus API

VoxNexus provides powerful voice service APIs, including Text-to-Speech (TTS) and Speech-to-Text (STT) capabilities. We offer two types of API interfaces:
  • REST API: Suitable for standard request-response scenarios, supporting both synchronous and streaming responses
  • WebSocket API: Ideal for real-time bidirectional communication scenarios, providing low-latency real-time voice processing

API Playground

All API endpoints support interactive testing through the API Playground. You can:
  • Test REST API endpoints directly in your browser
  • Try WebSocket connections with real-time message exchange
  • View request/response examples for each endpoint
  • Authenticate using your API key in the playground interface
The API Playground is available for all endpoints in the REST API and WebSocket API sections. Simply navigate to any endpoint page to access the interactive playground.

Authentication

All API endpoints require authentication. VoxNexus supports multiple authentication methods:

REST API Authentication

Use the X-Api-Key header in your request:
X-Api-Key: YOUR_API_KEY

WebSocket API Authentication

For WebSocket connections, you can authenticate using either method: Option 1: Query Parameter (Recommended)
wss://api.voxnexus.ai/v1/tts/realtime?token=YOUR_API_KEY
Option 2: Header
X-Api-Key: YOUR_API_KEY
Query parameter authentication is recommended for WebSocket connections as some WebSocket clients don’t support custom headers.
API Keys can be obtained and managed in the Dashboard.

Base URLs

  • REST API: https://api.voxnexus.ai
  • WebSocket API: wss://api.voxnexus.ai

Rate Limiting

API requests are subject to rate limiting and quota management. When limits are exceeded, the API returns a 429 status code.

Error Handling

All error responses follow a unified format:
{
  "error": "Error description",
  "code": "Error code",
  "details": "Detailed error information (optional)",
  "request_id": "Request ID (optional)"
}

Quick Start

REST API Example

curl -X POST https://api.voxnexus.ai/v1/tts \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello, this is a test message",
    "voice_id": "vl-xiaoxiao"
  }'

WebSocket API Example

// Connect with token as query parameter (recommended)
const ws = new WebSocket('wss://api.voxnexus.ai/v1/tts/realtime?token=YOUR_API_KEY');

ws.onopen = () => {
  // Send initialization message
  ws.send(JSON.stringify({
    type: 'init',
    voice_id: 'vl-xiaoxiao'
  }));
};

ws.onmessage = (event) => {
  const message = JSON.parse(event.data);
  console.log('Received:', message.type);
};