Skip to content

Audio, speech & music quickstart ​

Three separate synchronous endpoints, three different billing units. That last point is the one that catches people out, so it is the first table on this page.

Prerequisite: a key and a funded wallet — see the Quickstart.

Billing units differ per endpoint ​

CapabilityEndpointBilled per
MusicPOST /v1/ai/generate/musicminute of output
Sound effectsPOST /v1/ai/generate/sfxrequest
SpeechPOST /v1/ai/generate/speech1,000 characters of input
TranscriptionPOST /v1/ai/transcribeminute of input

Live rates: music-minimax $0.0797/min, music-elevenlabs $0.1993/min, sfx-elevenlabs $0.0598/request, tts-google $0.0239 per 1K characters, tts-elevenlabs $0.0478 per 1K characters, transcription $0.0159/min. Confirm against GET /v1/pricing before you rely on them.

Music ​

bash
curl -X POST https://apis.fotohub.app/v1/ai/generate/music \
  -H "Authorization: Bearer $FOTOHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax",
    "prompt": "warm lo-fi beat for a product demo",
    "genre": "lo-fi",
    "duration": 30,
    "bpm": 90,
    "instrumental": true
  }'
FieldNotes
promptRequired.
modelminimax or elevenlabs.
duration10–300 seconds. Checked before billing.
genreRequired for elevenlabs, optional for minimax.
moodOptional.
bpm60–200. tempo is accepted as a deprecated alias.
loopOptional.
instrumentalOptional.

duration and bpm are the providers' own limits and are validated before the wallet is touched, so an out-of-range value costs nothing.

Sound effects ​

bash
curl -X POST https://apis.fotohub.app/v1/ai/generate/sfx \
  -H "Authorization: Bearer $FOTOHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "a heavy wooden door closing in a stone hall", "duration": 5}'

duration is capped at 30 seconds. Billed per request, so a 5-second effect and a 30-second effect cost the same.

Speech ​

bash
curl -X POST https://apis.fotohub.app/v1/ai/generate/speech \
  -H "Authorization: Bearer $FOTOHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Dzień dobry — to jest test syntezy mowy.",
    "model": "google",
    "language": "pl",
    "speed": 1.0
  }'
FieldNotes
textRequired. Length cap depends on the model — see below.
modelgoogle, ida-voice-pro, ida-voice or grok.
voice_idOptional, model-specific. Leave it out for the model's default; grok takes names like eve.
languagee.g. pl, en, de.
speedDefault 1.0.
pitchDefault 0.
ModelCharacter capNotes
google3,000The cheap, fast tier
grok3,00026 multilingual voices
ida-voice-pro1,200The natural-sounding tier
ida-voice1,200Self-hosted on our own GPU

mars-flash, mars-pro, chatterbox-tts and the legacy elevenlabs alias are also accepted and map onto the same engines. Anything else is rejected with a 400 naming the supported set.

Over-length text is rejected before the wallet is touched, and the error says which cap you hit and that up to 3,000 characters is available on the mars-pro / mars-flash voices — so a too-long string costs you nothing.

Billed per 1,000 characters of input text, not per request — the same 200-character string costs the same whether the audio is fast or slow.

Provider-specific TTS ​

If you need a specific provider's voice catalogue rather than the generic endpoint, three provider routes are exposed directly, each with a matching voice listing:

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

There is also POST /v1/ai/generate/speech/gpt.

Transcription ​

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

The Voxtral pair transcribes and summarises in one pass; the plain route just transcribes.

What is priced but not exposed ​

The public catalogue (GET /v1/models?category=audio) lists four audio capabilities that have no public endpoint today: voice-clone, audio-mastering, audio-stems and audio-translation. They carry prices because they run inside the platform, but there is currently no API route that invokes them. Do not build against them until they appear in this reference.

Next ​

Music & Audio reference · Realtime Voice · Voice Agents