Skip to main content
Learn how to instantly generate lifelike audio from text using Novisurf’s fast TTS API.

Overview

The Novisurf speech endpoint lets you convert text to spoken audio in seconds. It is fully OpenAI-compatible — just swap the base URL and API key and your existing code works out of the box.

Endpoint

EndpointUsageURL
SpeechConvert text to audioPOST https://api2.novisurf.top/v1/audio/speech

Authentication

Bearer token (recommended)
X-API-Key: lsk_...
X-API-Key header
Authorization: Bearer lsk_...
Your API key is available in the Novisurf Dashboard.

Supported Models

Model IDDescription
shellai/melottsFast, lightweight multilingual TTS

Quick Start

The speech endpoint takes four key inputs:
  • model: the TTS model to use
  • input: the text to generate audio from
  • voice: the desired voice for output
  • response_format: defaults to mp3

Parameters

ParameterTypeRequiredDescription
modelstringYesTTS model ID.
inputstringYesText to synthesize.
voicestringYesVoice to use for output.
response_formatstringNoOutput audio format. Defaults to mp3.
speednumberNoPlayback speed from 0.25 to 4.0. Defaults to 1.0.

Python

from openai import OpenAI

client = OpenAI(
    api_key="lsk_...",
    base_url="https://api2.novisurf.top/v1"
)

speech_file_path = "speech.mp3"

response = client.audio.speech.create(
    model="shellai/melotts",
    voice="en-us",
    input="Hello! Welcome to Novisurf. Fast inference, built for developers.",
    response_format="mp3"
)

response.stream_to_file(speech_file_path)

JavaScript

import fs from "fs";
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "lsk_...",
  baseURL: "https://api2.novisurf.top/v1",
});

const speechFilePath = "speech.mp3";

async function main() {
  const response = await client.audio.speech.create({
    model: "shellai/melotts",
    voice: "en-us",
    input: "Hello! Welcome to Novisurf. Fast inference, built for developers.",
    response_format: "mp3",
  });

  const buffer = Buffer.from(await response.arrayBuffer());
  await fs.promises.writeFile(speechFilePath, buffer);

  console.log(`Speech generated: ${speechFilePath}`);
}

main().catch(console.error);

cURL

curl https://api2.novisurf.top/v1/audio/speech \
  -X POST \
  -H "X-API-Key: lsk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "shellai/melotts",
    "input": "Hello! Welcome to Novisurf. Fast inference, built for developers.",
    "voice": "en-us",
    "response_format": "mp3"
  }' \
  --output speech.mp3

Response

The response is raw audio binary in the requested format, not JSON. Save the response body directly to a file.
HeaderValue
Content-Typeaudio/mpeg for mp3, audio/wav for wav

Error Codes

StatusMeaning
400Bad request — missing or invalid parameters
401Unauthorized — invalid or missing API key
402Insufficient credits
429Rate limit exceeded
500Internal server error