Subspace Institute

ElevenLabs API

Generates speech audio from the provided text using ElevenLabs TTS service

POST
/tts-elevenlabs
textstring
Length1 <= length <= 10000
voicestring

Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.

Length1 <= length
model?string

Identifier of the model that will be used, you can query them using GET /v1/models. The model needs to have support for text to speech, you can check this using the can_do_text_to_speech property.

Default"eleven_flash_v2_5"
voice_settings?object

Voice settings overriding stored setttings for the given voice. They are applied only on the given request.

tokenstring

ElevenLabs API key for authentication

Length1 <= length
seed?number

If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result. Determinism is not guaranteed. Must be integer between 0 and 4294967295.

Rangevalue <= 4294967295
previous_text?string

The text that came before the text of the current request. Can be used to improve the flow of prosody when concatenating together multiple generations or to influence the prosody in the current generation.

next_text?string

The text that comes after the text of the current request. Can be used to improve the flow of prosody when concatenating together multiple generations or to influence the prosody in the current generation.

previous_request_ids?array<string>

A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both previous_text and previous_request_ids is send, previous_text will be ignored. A maximum of 3 request_ids can be send.

next_request_ids?array<string>

A list of request_id of the samples that were generated before this generation. Can be used to improve the flow of prosody when splitting up a large task into multiple requests. The results will be best when the same model is used across the generations. In case both next_text and next_request_ids is send, next_text will be ignored. A maximum of 3 request_ids can be send.

apply_text_normalization?string

This parameter controls text normalization with three modes: ‘auto’, ‘on’, and ‘off’. When set to ‘auto’, the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). With ‘on’, text normalization will always be applied, while with ‘off’, it will be skipped. Cannot be turned on for ‘eleven_turbo_v2_5’ model.

Default"auto"
Value in"auto" | "on" | "off"

Response Body

curl -X POST "https://edge-workers.laplace.cn/laplace/tts-elevenlabs" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
    "voice": "string",
    "token": "string"
  }'
const body = JSON.stringify({
  "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
  "voice": "string",
  "token": "string"
})

fetch("https://edge-workers.laplace.cn/laplace/tts-elevenlabs", {
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://edge-workers.laplace.cn/laplace/tts-elevenlabs"
  body := strings.NewReader(`{
    "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
    "voice": "string",
    "token": "string"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://edge-workers.laplace.cn/laplace/tts-elevenlabs"
body = {
  "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
  "voice": "string",
  "token": "string"
}
response = requests.request("POST", url, json = body, headers = {
  "Content-Type": "application/json"
})

print(response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
import java.time.Duration;
import java.net.http.HttpRequest.BodyPublishers;

var body = BodyPublishers.ofString("""{
  "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
  "voice": "string",
  "token": "string"
}""");
HttpClient client = HttpClient.newBuilder()
  .connectTimeout(Duration.ofSeconds(10))
  .build();

HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
  .uri(URI.create("https://edge-workers.laplace.cn/laplace/tts-elevenlabs"))
  .header("Content-Type", "application/json")
  .POST(body)
  .build();

try {
  HttpResponse<String> response = client.send(requestBuilder.build(), BodyHandlers.ofString());
  System.out.println("Status code: " + response.statusCode());
  System.out.println("Response body: " + response.body());
} catch (Exception e) {
  e.printStackTrace();
}
using System;
using System.Net.Http;
using System.Text;

var body = new StringContent("""
{
  "text": "感谢ドラゴンラプラスWeChat的SC:一发sc没被念到我就冷汗直流心跳加速头皮发麻双手痉挛两腿打颤,还不好意思刷弹幕说你漏了,我好怕你看到了装作没看到。我的sc通常很短只有一小时,只有短短的3600秒,但它存在的时候,我会用心跳来为它倒数。私のBANを解除してください。もう二度とスパムしません😭",
  "voice": "string",
  "token": "string"
}
""", Encoding.UTF8, "application/json");

var client = new HttpClient();
var response = await client.PostAsync("https://edge-workers.laplace.cn/laplace/tts-elevenlabs", body);
var responseBody = await response.Content.ReadAsStringAsync();
null
{
  "success": false,
  "message": "string",
  "code": "string",
  "type": "string"
}
{
  "success": false,
  "message": "string",
  "code": "string",
  "type": "string"
}