Beta

This API is in beta. Endpoints, request/response formats, and behavior may change without notice.

API Reference

Terramind Documentation

Voice & Music Endpoints

POST /api/v1/studio/voiceover/generate

Generate a voiceover from text using ElevenLabs text-to-speech.

Request Body

textstringrequired

Text to speak (1–5000 characters).

titlestringrequired

Title for the voiceover (1–255 characters).

voicestring

Voice name (default: george). Available voices: rachelle, drew, clyde, paul, domi, dave, fin, sarah, antoni, thomas, charlie, george, emily, elli, callum, patrick, harry, liam, dorothy, josh, arnold, adam, sam.

stabilitynumber

Voice stability (0–1, default: 0.5). Higher values are more consistent.

similarityBoostnumber

Similarity boost (0–1, default: 0.5). Higher values match the original voice more closely.

Example

curl
curl -X POST https://terramind.com/api/v1/studio/voiceover/generate \
  -H "Authorization: Bearer sk-tm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Welcome to Terramind, the unified AI platform.",
    "title": "Welcome Message",
    "voice": "sarah",
    "stability": 0.7
  }'

Response

JSON
{
  "success": true,
  "data": {
    "url": "https://storage.googleapis.com/...",
    "storagePath": "studios/.../voiceover.mp3",
    "format": "mp3",
    "title": "Welcome Message",
    "voice": "sarah",
    "model": "eleven_multilingual_v2",
    "textLength": 49,
    "metadata": { "stability": 0.7, "similarityBoost": 0.5 }
  },
  "credits": { "used": 1, "cost": 3.0, "remaining": 9997.0 }
}

POST /api/v1/studio/dialogue/generate

Generate a multi-voice dialogue. Each line is spoken by a different voice and stitched into a single audio file.

Request Body

inputsarrayrequired

Array of dialogue lines. Each line has text (string) and voiceId (string — a voice name from the list above).

titlestringrequired

Title for the dialogue (1–255 characters).

stabilitynumber

Voice stability (0–1, default: 0.5).

similarityBoostnumber

Similarity boost (0–1, default: 0.5).

Example

curl
curl -X POST https://terramind.com/api/v1/studio/dialogue/generate \
  -H "Authorization: Bearer sk-tm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputs": [
      { "text": "Hey, have you tried Terramind?", "voiceId": "george" },
      { "text": "Yes! The Studio API is amazing.", "voiceId": "sarah" }
    ],
    "title": "Product Chat"
  }'

Response

JSON
{
  "success": true,
  "data": {
    "url": "https://storage.googleapis.com/...",
    "storagePath": "studios/.../dialogue.mp3",
    "format": "mp3",
    "title": "Product Chat",
    "model": "elevenlabs-dialogue",
    "dialogueLines": [
      { "line": 1, "voice": "george", "text": "Hey, have you tried Terramind?" },
      { "line": 2, "voice": "sarah", "text": "Yes! The Studio API is amazing." }
    ],
    "voicesUsed": ["george", "sarah"],
    "totalLines": 2,
    "totalTextLength": 60,
    "metadata": { "stability": 0.5, "similarityBoost": 0.5, "chunks": 2 }
  },
  "credits": { "used": 1, "cost": 5.0, "remaining": 9995.0 }
}

POST /api/v1/studio/music/plan

Generate a composition plan for detailed music generation. The plan can be passed to the music generate endpoint for fine-grained control.

Request Body

promptstringrequired

Description of the desired music.

music_length_msnumber

Target duration in milliseconds.

source_composition_planobject

Existing composition plan to modify.

model_idstring

Model identifier.

Example

curl
curl -X POST https://terramind.com/api/v1/studio/music/plan \
  -H "Authorization: Bearer sk-tm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "An upbeat electronic track with synth leads and a driving beat",
    "music_length_ms": 60000
  }'

Response

JSON
{
  "positive_global_styles": ["electronic", "upbeat", "synth-driven"],
  "negative_global_styles": ["acoustic", "slow"],
  "sections": [
    {
      "section_name": "Intro",
      "positive_local_styles": ["ambient pad", "building"],
      "negative_local_styles": [],
      "duration_ms": 8000,
      "lines": ["Soft synth pad fading in"]
    },
    {
      "section_name": "Drop",
      "positive_local_styles": ["heavy bass", "energetic"],
      "negative_local_styles": ["quiet"],
      "duration_ms": 16000,
      "lines": ["Full energy drop with driving beat"]
    }
  ]
}

POST /api/v1/studio/music/generate

Generate music from a text prompt or a composition plan. Returns an MP3 audio file URL.

Request Body

promptstring

Music description (used when no composition plan is provided).

composition_planobject

Composition plan from the /studio/music/plan endpoint.

durationSecondsnumber

Duration in seconds (default: 30).

coverPromptstring

Prompt for cover art generation (full mode only).

force_instrumentalboolean

Generate without vocals (default: false).

model_idstring

Model identifier.

modestring

Generation mode: full (with cover art and lyrics) or audio-only (default: full).

Example

curl
curl -X POST https://terramind.com/api/v1/studio/music/generate \
  -H "Authorization: Bearer sk-tm-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Chill lo-fi hip hop beat for studying",
    "durationSeconds": 60,
    "force_instrumental": true,
    "mode": "audio-only"
  }'

Response

JSON
{
  "success": true,
  "data": {
    "url": "https://storage.googleapis.com/...",
    "storagePath": "studios/.../music.mp3",
    "format": "mp3",
    "duration": 60000,
    "title": null,
    "model": "elevenlabs-music"
  },
  "credits": { "used": 1, "cost": 10.0, "remaining": 9990.0 }
}