Skip to content

Music & Audio

Complete audio generation and processing suite. Generate original music tracks and sound effects from text descriptions, convert text to natural-sounding speech with multiple voice options, transcribe audio to text, translate audio between languages, and dub content while preserving speaker voice characteristics.

CapabilityDescriptionDuration/Limits
MusicAI Composition (IDA Music, MiniMax)5–480 seconds
SFXSound Effectsinstant generation
TTSText-to-Speech (IDA Voice)30+ languages
STTTranscriptionauto language detect

IDA Music

FOTOhub's proprietary music generation engine — IDA Music — runs on dedicated GPU infrastructure. It generates full songs with vocals, lyrics, and complex arrangements up to 8 minutes long.

Endpoint

POST /v1/ai/generate/music

Use model: "ida-music" to route to IDA Music.

Billing: 2 credits (≤3 min) or 4 credits (>3 min)

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYesDetailed description: genre, instruments, mood, vocal style, energy.
modelstringYesMust be "ida-music"
lyricsstringNoSong lyrics with structure tags: [verse], [chorus], [bridge], [outro]. Auto-generated if omitted.
durationintegerNo120Duration in seconds. Range: 30–480.
bpmintegerNoautoTarget tempo (60–220 BPM).
key_scalestringNoautoMusical key: "C major", "A minor", "F# major", etc.
time_signaturestringNo"4/4"Time signature: "4/4", "3/4", "6/8", "5/4", "7/8".
vocal_languagestringNo"en"Vocal language: "en", "zh", "ja", "ko", "es", "fr", "de", "it", "pt", "ru", "ar", "hi", "instrumental".
vocal_genderstringNo"auto""male", "female", or "auto".
is_instrumentalbooleanNofalseWhen true, generates instrumental only (ignores lyrics/vocal params).
qualitystringNo"standard""draft" (fast, 20 steps), "standard" (balanced, 40 steps), "high" (best, 50 steps), "max" (highest, Heun sampler).
batch_sizeintegerNo1Generate 1–4 variations in one request.
seedintegerNorandomReproducibility seed.
audio_formatstringNo"mp3"Output format: "mp3", "wav", "flac".

Quality Presets

PresetStepsGuidanceSamplerSpeed
draft205.0Euler~15s
standard405.0Euler~30s
high507.0Euler~45s
max507.0Heun + ADG~90s

Response

json
{
  "model": "ida-music",
  "credits_used": 2,
  "audio_url": "https://gpu.fotohub.app/static/generations/ida_m_abc123.mp3",
  "audio_urls": ["https://gpu.fotohub.app/static/generations/ida_m_abc123.mp3"],
  "title": "Neon Pulse",
  "lyrics": "[verse]\nCity lights are burning bright...",
  "duration": 120,
  "metadata": {
    "bpm": 128,
    "key_scale": "A minor",
    "time_signature": "4/4",
    "vocal_language": "en",
    "seed": 42
  }
}

Compose Lyrics (Free)

Generate lyrics and suggested parameters using the built-in AI composer — no credits charged.

POST /v1/ai/generate/music/compose
json
{
  "prompt": "Upbeat summer pop song about road trips and freedom",
  "vocal_language": "en",
  "vocal_gender": "female",
  "duration": 180
}

Response:

json
{
  "lyrics": "[verse]\nWindows down on the highway...\n[chorus]\nWe're chasing sunsets...",
  "title": "Highway Sunsets",
  "cover_prompt": "Retro convertible driving through desert at golden hour",
  "suggested_bpm": 118,
  "suggested_key": "G major",
  "suggested_time_signature": "4/4",
  "suggested_duration": 180,
  "suggested_genre": "pop"
}

Lyric Structure Tags

Use these tags in lyrics to control song structure:

[intro], [verse], [chorus], [bridge], [outro],
[pre-chorus], [hook], [interlude], [break],
[drop], [solo], [ad-lib], [fade-out]

Example

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/generate/music",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "Epic cinematic orchestral piece with soaring strings, "
                  "powerful brass, and dramatic percussion. Build from quiet "
                  "to a thunderous climax.",
        "model": "ida-music",
        "duration": 180,
        "key_scale": "D minor",
        "time_signature": "4/4",
        "is_instrumental": True,
        "quality": "high",
        "audio_format": "flac"
    }
)

result = response.json()
print(f"Audio: {result['audio_url']}")
print(f"Credits: {result['credits_used']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/generate/music",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "Epic cinematic orchestral piece with soaring strings, " +
              "powerful brass, and dramatic percussion.",
      model: "ida-music",
      duration: 180,
      key_scale: "D minor",
      time_signature: "4/4",
      is_instrumental: true,
      quality: "high",
      audio_format: "flac",
    }),
  }
);

const result = await response.json();
console.log(`Audio: ${result.audio_url}`);
bash
curl -X POST "https://apis.fotohub.app/v1/ai/generate/music" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Epic cinematic orchestral piece with soaring strings, powerful brass, and dramatic percussion.",
    "model": "ida-music",
    "duration": 180,
    "key_scale": "D minor",
    "is_instrumental": true,
    "quality": "high",
    "audio_format": "flac"
  }'

IDA Music vs Cloud Models

IDA Music runs on FOTOhub's own GPU infrastructure, which means: lower latency for European users, no external rate limits, full control over output quality, and significantly lower cost (2–4 credits vs 5–25 for cloud models). Use IDA Music for production music, and MiniMax for quick drafts or specific vocal styles.


Music Generation (Cloud)

Endpoint

POST /v1/ai/generate/music

Billing: 5–25 credits (tiered by duration)

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYesDetailed description of the music. Include genre, instruments, mood, energy level, and intended use case.
modelstringNo"minimax""minimax" — cloud music generation with tiered pricing.
durationintegerNo30Duration in seconds. Range: 5–180. Longer tracks cost more.
genrestringNoGenre hint: "electronic", "jazz", "classical", "hip-hop", "ambient", "rock", "folk", "cinematic".
moodstringNoMood hint: "happy", "melancholic", "energetic", "calm", "dark", "uplifting", "mysterious".
tempointegerNo120Target tempo in BPM. Range: 60–200.
instrumentalbooleanNotrueWhen true, generates instrumental-only (no vocals). Set false for vocal elements.

Pricing

ModelCreditsPLNNotes
MiniMax Music5 / 10 / 250.30/min≤30s: 5cr, ≤60s: 10cr, >60s: 25cr

Response

json
{
  "model": "minimax",
  "credits_used": 5,
  "billing": {
    "method": "credits",
    "credits_used": 5,
    "pln_charged": 1.50
  },
  "audio_url": "https://s1.fotohub.app/storage/v1/object/public/generations/audio/mj_xyz789.mp3",
  "duration": 30,
  "format": "mp3"
}

Credit Tiers (MiniMax)

MiniMax uses tiered pricing: 5 credits for ≤30s, 10 credits for ≤60s, 25 credits for >60s (up to 180s).

Example

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/generate/music",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "Upbeat electronic dance track with pulsing synths, "
                  "crisp hi-hats, deep bass drops, and euphoric buildup "
                  "sections. Suitable for a product launch video.",
        "model": "minimax",
        "duration": 60,
        "genre": "electronic",
        "mood": "energetic",
        "tempo": 128,
        "instrumental": True
    }
)

result = response.json()
print(f"Audio URL: {result['audio_url']}")
print(f"Duration: {result['duration']}s")
print(f"Credits used: {result['credits_used']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/generate/music",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "Upbeat electronic dance track with pulsing synths, " +
              "crisp hi-hats, deep bass drops, and euphoric buildup " +
              "sections. Suitable for a product launch video.",
      model: "minimax",
      duration: 60,
      genre: "electronic",
      mood: "energetic",
      tempo: 128,
      instrumental: true,
    }),
  }
);

const result = await response.json();
console.log("Audio URL:", result.audio_url);
console.log(`Duration: ${result.duration}s`);
console.log(`Credits used: ${result.credits_used}`);
bash
curl -X POST "https://apis.fotohub.app/v1/ai/generate/music" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Upbeat electronic dance track with pulsing synths, crisp hi-hats, deep bass drops, and euphoric buildup sections.",
    "model": "minimax",
    "duration": 60,
    "genre": "electronic",
    "mood": "energetic",
    "tempo": 128,
    "instrumental": true
  }'

Sound Effects

Endpoint

POST /v1/ai/generate/sfx

Billing: 3 credits (fixed, regardless of duration)

Parameters

ParameterTypeRequiredDefaultDescription
promptstringYesDescription of the sound effect. Be specific about source, environment, and characteristics.
durationintegerNo5Duration in seconds. Range: 1–30. Most SFX work best at 3–10 seconds.

Response

json
{
  "credits_used": 3,
  "billing": {
    "method": "credits",
    "credits_used": 3,
    "pln_charged": 0.225
  },
  "audio_url": "https://s1.fotohub.app/storage/v1/object/public/generations/sfx/sfx_r4nd0m.mp3",
  "duration": 5,
  "format": "mp3"
}

Example

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/generate/sfx",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "Sci-fi laser gun firing three rapid shots, "
                  "with a reverberating echo in a metallic corridor",
        "duration": 3
    }
)

result = response.json()
print(f"SFX URL: {result['audio_url']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/generate/sfx",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "Sci-fi laser gun firing three rapid shots, " +
              "with a reverberating echo in a metallic corridor",
      duration: 3,
    }),
  }
);

const result = await response.json();
console.log("SFX URL:", result.audio_url);
bash
curl -X POST "https://apis.fotohub.app/v1/ai/generate/sfx" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Sci-fi laser gun firing three rapid shots, with a reverberating echo in a metallic corridor",
    "duration": 3
  }'

Text-to-Speech

Endpoint

POST /v1/ai/generate/speech

Billing: 1–2 credits per 1000 characters

Parameters

ParameterTypeRequiredDefaultDescription
textstringYesText to synthesize. Max 5000 characters. Supports SSML for advanced control.
modelstringNo"google"TTS engine: "google" (fast, cost-effective) or "ida-voice" (natural, cloned voices).
voice_idstringNoVoice preset ID. Google: "pl-PL-Standard-A", "en-US-Neural2-F", etc. IDA Voice: custom voice ID from dashboard.
languagestringNo"en"Target language: "pl", "en", "de", "fr", "es".
speednumberNo1.0Speech speed multiplier. Range: 0.5–2.0.
pitchnumberNo0Pitch adjustment in semitones. Range: -10 to +10.

Pricing

ModelCreditsPLNNotes
Google Cloud TTS10.09per 1000 characters, fast
IDA Voice Pro20.18per 1000 characters, natural voice, cloning

Response

json
{
  "model": "google",
  "credits_used": 1,
  "billing": {
    "method": "credits",
    "credits_used": 1,
    "pln_charged": 0.09
  },
  "audio_url": "https://s1.fotohub.app/storage/v1/object/public/generations/speech/tts_k8m2n1.mp3",
  "duration": 12.4,
  "format": "mp3",
  "characters_processed": 847
}

Example

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/generate/speech",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "text": "Witaj w FOTOhub! Nasza platforma umozliwia "
                "generowanie obrazow, wideo i muzyki za pomoca "
                "sztucznej inteligencji.",
        "model": "google",
        "voice_id": "pl-PL-Standard-B",
        "language": "pl",
        "speed": 1.0,
        "pitch": 0
    }
)

result = response.json()
print(f"Audio URL: {result['audio_url']}")
print(f"Duration: {result['duration']}s")
print(f"Characters processed: {result['characters_processed']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/generate/speech",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      text: "Witaj w FOTOhub! Nasza platforma umozliwia " +
            "generowanie obrazow, wideo i muzyki za pomoca " +
            "sztucznej inteligencji.",
      model: "google",
      voice_id: "pl-PL-Standard-B",
      language: "pl",
      speed: 1.0,
      pitch: 0,
    }),
  }
);

const result = await response.json();
console.log("Audio URL:", result.audio_url);
console.log(`Duration: ${result.duration}s`);
console.log(`Characters: ${result.characters_processed}`);
bash
curl -X POST "https://apis.fotohub.app/v1/ai/generate/speech" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Witaj w FOTOhub! Nasza platforma umozliwia generowanie obrazow, wideo i muzyki za pomoca sztucznej inteligencji.",
    "model": "google",
    "voice_id": "pl-PL-Standard-B",
    "language": "pl",
    "speed": 1.0,
    "pitch": 0
  }'

IDA Voice Cloning

With IDA Voice Pro, you can use custom cloned voices. Upload a voice sample via the FOTOhub dashboard to create a custom voice_id, then reference it in API calls. Cloned voices support all languages with natural accent preservation.


Text-to-Speech (Polly)

Budget TTS with 106 neural/generative voices across 41 languages. 10-50x cheaper than premium providers.

Endpoints

GET  /v1/ai/tts/polly/voices
POST /v1/ai/tts/polly/synthesize

Billing: 1 credit per 10,000 characters

List Voices

GET /v1/ai/tts/polly/voices?language=pl-PL

Returns available voices filtered by language code.

Response:

json
{
  "voices": [
    {
      "id": "Ola",
      "name": "Ola",
      "language": "pl-PL",
      "language_name": "Polish",
      "gender": "Female",
      "engines": ["generative", "neural"]
    }
  ],
  "count": 5
}

Synthesize Speech

ParameterTypeRequiredDefaultDescription
textstringYesText to synthesize. Max 10,000 characters. Supports SSML.
voice_idstringNo"Ola"Voice ID from the voices list.
enginestringNo"neural"Engine: "neural", "generative", or "standard".
output_formatstringNo"mp3"Format: "mp3", "ogg_vorbis", or "pcm".
language_codestringNoLanguage hint (e.g., "pl-PL", "en-US").

Response: Audio stream (binary) with headers:

  • X-Credits-Used — credits charged
  • X-Characters — characters processed

Example

python
from fotohub import FotoHub

client = FotoHub(api_key="fh_live_...")
audio = client.tts.polly(
    text="Witaj w FOTOhub!",
    voice_id="Ola",
    engine="neural"
)
# audio is bytes (mp3)
with open("output.mp3", "wb") as f:
    f.write(audio)
bash
curl -X POST "https://apis.fotohub.app/v1/ai/tts/polly/synthesize" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -o output.mp3 \
  -d '{
    "text": "Witaj w FOTOhub! Generuję mowę za pomocą AI.",
    "voice_id": "Ola",
    "engine": "neural",
    "output_format": "mp3"
  }'

Pricing

EngineCost (AWS)CreditsLanguages
Neural$0.016/1K chars1 per 10K chars41
Generative$0.030/1K chars1 per 10K chars41
Standard$0.004/1K chars1 per 10K chars41

Polish Voices

Available Polish voices: Ola (Female, neural+generative), Ewa (Female, generative), Maja (Female, standard), Jan (Male, standard), Jacek (Male, standard).


Text-to-Speech (GPT Audio 1.5)

Premium AI voice synthesis using OpenAI's GPT Audio 1.5 model. Natural-sounding speech with voice style instructions support — describe the tone, emotion, and pace you want.

Endpoint

POST /v1/ai/generate/speech/gpt

Billing: 2 credits per request

Parameters

ParameterTypeRequiredDefaultDescription
textstringYesText to synthesize. Max 10,000 characters.
voicestringNo"alloy"Voice: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse
instructionsstringNoVoice style instructions. E.g., "Speak calmly like an audiobook narrator" or "Energetic sports commentator tone".

Pricing

ModelCreditsPLNNotes
GPT Audio 1.520.40per request, WAV HD output

Response

json
{
  "credits_used": 2,
  "audio_url": "https://s1.fotohub.app/storage/v1/object/public/audio/gpt-tts/...",
  "transcript": "The text as spoken by the model",
  "model": "gpt-audio-1.5",
  "voice": "nova",
  "format": "wav",
  "usage": {
    "input_tokens": 32,
    "output_tokens": 216,
    "total_tokens": 248
  }
}

Example

python
from fotohub import FotoHub

client = FotoHub(api_key="fh_live_your_key")

result = client.audio.speech(
    text="Welcome to FOTOhub! Generate images, video, and music with AI.",
    voice="nova",
    instructions="Speak warmly and naturally, like a podcast host",
)
print(f"Audio: {result.audio_url}")
bash
curl -X POST "https://apis.fotohub.app/v1/ai/generate/speech/gpt" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Welcome to FOTOhub! Generate images, video, and music with AI.",
    "voice": "nova",
    "instructions": "Speak warmly and naturally, like a podcast host"
  }'

Voice Style Instructions

GPT Audio 1.5 supports freeform instructions for voice style. You can control tone, pace, emotion, and speaking style. Examples:

  • "Speak slowly and clearly, like a meditation guide"
  • "Excited and energetic, like announcing a product launch"
  • "Professional news anchor tone, neutral and clear"
  • "Whispered, intimate storytelling voice"

Speech-to-Text (Voxtral)

LLM-quality transcription using Mistral Voxtral models. Better context understanding than traditional ASR.

Endpoints

POST /v1/ai/transcribe/voxtral/transcribe
POST /v1/ai/transcribe/voxtral/summarize

Billing: 1–2 credits per audio file

Transcribe

ParameterTypeRequiredDefaultDescription
audiostringYesBase64-encoded audio (WAV, MP3, OGG, FLAC, WebM). Max 25MB.
modelstringNo"voxtral-small"Model: "voxtral-small" (24B, quality) or "voxtral-mini" (3B, fast).
languagestringNoLanguage hint for better accuracy.
promptstringNoContext/instruction for the model.

Response:

json
{
  "text": "Transcribed text content here...",
  "model": "voxtral-small",
  "credits_used": 2,
  "tokens": { "input": 1200, "output": 150 }
}

Summarize

Same parameters as transcribe, plus:

ParameterTypeRequiredDefaultDescription
formatstringNo"bullets"Summary format: "bullets" or "paragraph".

Returns both transcription and summary in a single call (3 credits).

Pricing

ModelCreditsQualitySpeed
Voxtral Small 24B2High (LLM-quality context)~10s
Voxtral Mini 3B1Good (fast)~3s

Speech-to-Text (Transcription)

Endpoint

POST /v1/ai/transcribe

Billing: 1 credit per minute of audio

Parameters

ParameterTypeRequiredDefaultDescription
audio_urlstringYesURL of audio file (MP3, WAV, M4A, FLAC, OGG, WebM). Max 500MB, max 4 hours.
languagestringNo"auto"Source language or "auto" for detection. Options: "pl", "en", "de", "fr", "es".
modestringNo"transcribe""transcribe" (same language), "translate" (to English), or "dub" (re-synthesize in target language).
timestampsbooleanNotrueInclude word-level timestamps for subtitle generation.
diarizebooleanNofalseEnable speaker diarization (identify different speakers).

Response

json
{
  "credits_used": 3,
  "billing": {
    "method": "credits",
    "credits_used": 3,
    "pln_charged": 0.18
  },
  "text": "Dzien dobry, chcialbym zamowic projekt graficzny dla mojej firmy...",
  "language_detected": "pl",
  "duration_minutes": 2.8,
  "segments": [
    {
      "start": 0.0,
      "end": 3.2,
      "text": "Dzien dobry, chcialbym zamowic",
      "speaker": null
    },
    {
      "start": 3.2,
      "end": 6.8,
      "text": "projekt graficzny dla mojej firmy...",
      "speaker": null
    }
  ],
  "confidence": 0.96
}

Example

python
import requests

response = requests.post(
    "https://apis.fotohub.app/v1/ai/transcribe",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "audio_url": "https://s1.fotohub.app/storage/v1/object/public/uploads/meeting-recording.mp3",
        "language": "auto",
        "mode": "transcribe",
        "timestamps": True,
        "diarize": True
    }
)

result = response.json()
print(f"Detected language: {result['language_detected']}")
print(f"Full transcript: {result['text']}")

for segment in result["segments"]:
    speaker = segment.get("speaker", "Unknown")
    print(f"[{segment['start']:.1f}s - {segment['end']:.1f}s] "
          f"Speaker {speaker}: {segment['text']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/transcribe",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      audio_url: "https://s1.fotohub.app/storage/v1/object/public/uploads/meeting-recording.mp3",
      language: "auto",
      mode: "transcribe",
      timestamps: true,
      diarize: true,
    }),
  }
);

const result = await response.json();
console.log(`Detected language: ${result.language_detected}`);
console.log(`Full transcript: ${result.text}`);

for (const segment of result.segments) {
  const speaker = segment.speaker ?? "Unknown";
  console.log(
    `[${segment.start.toFixed(1)}s - ${segment.end.toFixed(1)}s] ` +
    `Speaker ${speaker}: ${segment.text}`
  );
}
bash
curl -X POST "https://apis.fotohub.app/v1/ai/transcribe" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://s1.fotohub.app/storage/v1/object/public/uploads/meeting-recording.mp3",
    "language": "auto",
    "mode": "transcribe",
    "timestamps": true,
    "diarize": true
  }'

Audio Translation

Uses the same endpoint as transcription with mode: "translate".

POST /v1/ai/transcribe

Billing: 2 credits per minute of audio

Set "mode": "translate" to translate any spoken audio to English text.

Response

json
{
  "credits_used": 4,
  "billing": {
    "method": "credits",
    "credits_used": 4,
    "pln_charged": 0.24
  },
  "text": "Good morning, I would like to order a graphic design project for my company...",
  "source_language": "pl",
  "target_language": "en",
  "duration_minutes": 2.0,
  "confidence": 0.94
}

INFO

Audio translation always outputs English text, regardless of source language. The source language is auto-detected and reported in the response.


Audio Dubbing

Translate and re-synthesize audio while preserving the original speaker's voice characteristics.

POST /v1/ai/transcribe

Billing: 5 credits per minute of audio

Additional Parameters

ParameterTypeRequiredDescription
modestringYesMust be "dub"
target_languagestringYesTarget language: "pl", "en", "de", "fr", "es"
preserve_timingbooleanNoMatch original speech timing for video sync (default: true)

Response

json
{
  "credits_used": 15,
  "billing": {
    "method": "credits",
    "credits_used": 15,
    "pln_charged": 0.90
  },
  "audio_url": "https://s1.fotohub.app/storage/v1/object/public/generations/dubbed/dub_q2w3e4.mp3",
  "source_language": "pl",
  "target_language": "en",
  "duration_minutes": 3.0,
  "speakers_detected": 2,
  "format": "mp3"
}

Example

python
import requests

# Dub a Polish podcast episode into English
response = requests.post(
    "https://apis.fotohub.app/v1/ai/transcribe",
    headers={
        "Authorization": "Bearer fh_live_your_api_key",
        "Content-Type": "application/json"
    },
    json={
        "audio_url": "https://s1.fotohub.app/storage/v1/object/public/uploads/podcast-ep01.mp3",
        "mode": "dub",
        "target_language": "en",
        "preserve_timing": True
    }
)

result = response.json()
print(f"Dubbed audio: {result['audio_url']}")
print(f"Source: {result['source_language']} -> Target: {result['target_language']}")
print(f"Speakers detected: {result['speakers_detected']}")
print(f"Credits used: {result['credits_used']}")
typescript
const response = await fetch(
  "https://apis.fotohub.app/v1/ai/transcribe",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer fh_live_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      audio_url: "https://s1.fotohub.app/storage/v1/object/public/uploads/podcast-ep01.mp3",
      mode: "dub",
      target_language: "en",
      preserve_timing: true,
    }),
  }
);

const result = await response.json();
console.log(`Dubbed audio: ${result.audio_url}`);
console.log(`Source: ${result.source_language} -> Target: ${result.target_language}`);
console.log(`Speakers detected: ${result.speakers_detected}`);
console.log(`Credits used: ${result.credits_used}`);
bash
curl -X POST "https://apis.fotohub.app/v1/ai/transcribe" \
  -H "Authorization: Bearer fh_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://s1.fotohub.app/storage/v1/object/public/uploads/podcast-ep01.mp3",
    "mode": "dub",
    "target_language": "en",
    "preserve_timing": true
  }'

Processing Time

Audio dubbing is the most computationally intensive audio operation. Expect processing times of 2–5× the audio duration. For files longer than 10 minutes, the response will include a job_id for asynchronous polling.


Pricing Summary

ServiceModelCreditsPLN CostUnit
MusicIDA Music (≤3 min)20.15per generation
MusicIDA Music (>3 min)40.30per generation
MusicMiniMax5–250.30/mintiered by duration
Sound Effects30.225fixed per generation
TTS (IDA Voice)google10.09per 1000 characters
TTS (IDA Voice)ida-voice20.18per 1000 characters
Transcription10.06per minute of audio
Translation20.12per minute of audio
Dubbing50.30per minute of audio

Error Responses

StatusCodeDescription
400bad_requestInvalid parameters: unsupported format, duration out of range, invalid voice_id.
402insufficient_creditsNot enough credits for the requested operation.
413file_too_largeAudio file exceeds 500MB. Compress or split before uploading.
422unprocessable_audioFile corrupted, unsupported codec, or no detectable speech.
429rate_limit_exceededAudio limits: 20 req/min (TTS/SFX), 10 req/min (music), 5 req/min (transcription/dubbing).