camelAI Documentation

Channels and voice

Voice and audio: transcription, speech, and voice library in camelRun v2

Transcribe audio with POST /v2/transcriptions, synthesize speech with POST /v2/speech, and search voices with GET /v2/voices/search.

View as Markdown

camelRun v2 provides standalone audio endpoints for speech-to-text transcription, text-to-speech synthesis, and searching built-in and ElevenLabs voices. All three require a tenant API key (cr_live_...).

For live bidirectional voice conversations, see Voice calls and sessions.

Transcribe audio (POST /v2/transcriptions)

POST /v2/transcriptions accepts either multipart/form-data (with a file part plus optional model and prompt fields) or application/json (with audioBase64, optional filename, model, prompt). It uses whisper-1 by default with your tenant OpenAI key or the platform key.

ts
import { readFile } from "node:fs/promises";

const bytes = await readFile("voicemail.wav");
const transcript = await client.media.transcribe({
  file: bytes,
  filename: "voicemail.wav",
  model: "whisper-1",
});

console.log(transcript.text);

Over REST

bash
curl -s -X POST "https://run.camelai.com/v2/transcriptions" \
  -H "Authorization: Bearer $CAMELRUN_API_KEY" \
  -F "file=@voicemail.wav" \
  -F "model=whisper-1"

Response:

json
{
  "id": "aud_...",
  "text": "Hi, can you check on order 42?",
  "model": "whisper-1",
  "costUsd": 0.0006
}

Synthesize speech (POST /v2/speech)

POST /v2/speech converts text (input or text) into audio bytes using gpt-4o-mini-tts and voice alloy by default.

ts
import { writeFile } from "node:fs/promises";

const speech = await client.media.speech({
  input: "Your order has shipped and arrives Thursday.",
  voice: "coral",
  model: "gpt-4o-mini-tts",
  format: "mp3", // "mp3" | "wav" | "pcm"
});

await writeFile("reply.mp3", speech.audio!);

Over REST

bash
curl -s -X POST "https://run.camelai.com/v2/speech" \
  -H "Authorization: Bearer $CAMELRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Your order has shipped.",
    "voice": "coral",
    "format": "mp3"
  }' \
  -D - -o reply.mp3

The response body contains raw audio bytes with Content-Type set to the audio MIME type (for example audio/mpeg or audio/wav) and an X-Media-Id: tts_... header.

Search voices (GET /v2/voices/search)

GET /v2/voices/search lists available voices across elevenlabs (default, backed by the ElevenLabs shared voice library when ELEVENLABS_API_KEY or a tenant elevenlabs provider key is configured), openai, grok, and gemini:

bash
curl -s "https://run.camelai.com/v2/voices/search?provider=openai&q=calm&limit=10" \
  -H "Authorization: Bearer $CAMELRUN_API_KEY"

Query parameters:

ParameterDescription
providerelevenlabs (default), openai, grok, or gemini
qOptional search text
categoryOptional category filter (ElevenLabs)
limitNumber of results, 1..50 (default 10)

Returns { "voices": [{ provider, id, name, description, labels, previewUrl, category, publicOwnerId }] }.