BV BedVibe API Functional Docs + Live Tester
Checking session...
BedVibe Text To Speech API

Live docs for voice lookup, authenticated TTS, and instant audio playback.

This page now uses the production BedVibe API contract. It loads your current Supabase session, fetches live voices from /api/voices, builds the base_voice and emotion request body, sends /api/tts, and plays the raw audio response in-browser.

Use base_voice and emotion for TTS requests. The backend does not use speaker.
Base URL
https://api.bedvibe.studio
Auth
Authorization: Bearer <Supabase access token>
Response
Raw audio bytes, typically audio/wav
Session Status

Current account context

Checking your BedVibe session and preparing the live tester.

Detected Token
Waiting for session...
Voice Catalog
Loading live voices...

Live tester

The speaker selector is populated from Object.keys(base_voices). The emotion selector is populated from base_voices[selectedSpeaker]. If a selected speaker has no emotions, the tester automatically falls back to neutral.

The request body always sends language: "en" for this page.
The tester sends return_visemes: false and return_audio_base64: false.

Request preview

{
  "text": "",
  "language": "en",
  "base_voice": "YOUR_BASE_VOICE",
  "emotion": "neutral",
  "hd": false,
  "return_visemes": false,
  "return_audio_base64": false
}

Audio response

`res.blob()` -> `URL.createObjectURL(blob)`

Endpoints

These are the two core routes used by the page below. The live tester calls both against the BedVibe production API.

GET /api/voices

Returns the live voice catalog.

The UI uses Object.keys(base_voices) for the speaker list and base_voices[selectedSpeaker] for the emotion list.

POST /api/tts

Requires Authorization: Bearer <Supabase access token>.

Accepts text, language, base_voice, emotion, and hd, then responds with raw audio bytes.

Live voices response shape

{
  "count": 0,
  "voice_ids": [],
  "base_voices": {
    "YOUR_BASE_VOICE": ["neutral"]
  }
}

Auth header

Authorization: Bearer YOUR_SUPABASE_ACCESS_TOKEN

Examples

The examples below stay aligned with the live tester and use base_voice plus emotion instead of the older speaker field.

JSON body

{
  "text": "Welcome to BedVibe.",
  "language": "en",
  "base_voice": "YOUR_BASE_VOICE",
  "emotion": "neutral",
  "hd": false,
  "return_visemes": false,
  "return_audio_base64": false
}

cURL

curl -X POST "https://api.bedvibe.studio/api/tts" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "text": "Welcome to BedVibe.",
    "language": "en",
    "base_voice": "YOUR_BASE_VOICE",
    "emotion": "neutral",
    "hd": false,
    "return_visemes": false,
    "return_audio_base64": false
  }'

JavaScript

const token = "YOUR_ACCESS_TOKEN";

const res = await fetch("https://api.bedvibe.studio/api/tts", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${token}`
  },
  body: JSON.stringify({
    text: "Welcome to BedVibe.",
    language: "en",
    base_voice: "YOUR_BASE_VOICE",
    emotion: "neutral",
    hd: false,
    return_visemes: false,
    return_audio_base64: false
  })
});

if (!res.ok) {
  throw new Error("TTS request failed");
}

const blob = await res.blob();
const url = URL.createObjectURL(blob);
audio.src = url;
audio.play();
Implementation Notes

What this page is doing

  • Loads /supabaseClient.js and /auth.js from the existing BedVibe site.
  • Reads the current Supabase session access token from the active browser session.
  • Calls /api/voices to build the speaker and emotion selectors.
  • Calls /api/tts with base_voice, emotion, and raw audio response handling.
  • Shows login state, request errors, and playback controls directly in the page.

If the voice catalog changes on the backend, this page will pick up the new base_voices mapping automatically on refresh.