Build with Audexum.
REST API. Bearer auth. JSON in, WAV/MP3/OGG/Opus out. Streaming and webhooks included.
Autenticação
Gere uma chave de API em Configurações do desenvolvedor. Envie-a como token Bearer em todas as requisições.
Authorization: Bearer sk_live_•••••••••••••••••••••••••••••••••POST/api/synthesize
Gere áudio a partir de texto. Retorna audio/wav por padrão (44.1 kHz, PCM de 16 bits, mono). Use format para MP3/OGG/Opus ou stream=true para streaming em blocos com baixa latência.
# The shortest call there is. No backend named, so you get
# V3 Expressive on the Atlas voice — our most expressive engine.
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"text": "Hello world"}' \
--output hello.wav
# V2 Multilingual, where speed and steps apply and 32 languages are available.
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"text": "Hello world",
"backend": "v2",
"voice": "M1",
"lang": "en",
"speed": 1.05,
"steps": 8
}' \
--output hello.wavCorpo da requisição
Níveis de voz
Escolha um nível com backend. Cada nível tem suas próprias vozes e um multiplicador de créditos por caractere. Enviar uma voz desconhecida para o nível retorna 400.
Omita backend e o nível será inferido: uma voz V2 (F1..F5, M1..M5) mantém você no V2 Multilingual, uma voz V3 seleciona V3 Expressive e não nomear nenhuma oferece V3 Expressive emAtlasnível devoz . Integrações existentes que enviam apenas um nível de voz não são afetadas e mantêm a cobrança no multiplicador desse nível.
| backend | Nível | Custo | vozes |
|---|---|---|---|
| v1 | V1 Instant: rápido, pensado primeiro para o inglês | 1× | Veja /api/voices |
| v2 | V2 Multilingual: 32 idiomas, incluindo português | 1.5× | F1..F5, M1..M5 |
| v3 | V3 Expressive: o mais expressivo, com emoção e estilo | 2× | Atlas, Reid, Sage, Kai, Cole, Ivy, Mira, Elle, Nova |
# V3 Expressive — most expressive tier, with an optional style prompt
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"text": "We shipped it. Finally.",
"backend": "v3",
"voice": "Atlas",
"instruct": "warm, relieved, unhurried"
}' \
--output ultra.wavCabeçalhos da resposta
Formatos de saída (OGG / Opus / MP3)
Adicione "format": "ogg" (ou mp3 / opus) para receber uma resposta transcodificada. A cota é a mesma independentemente do formato. A marca d’água AudioSeal permanece após a codificação em MP3.
# OGG/Opus — smallest file size, best for streaming/web
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"text": "Hello", "voice": "M1", "lang": "en", "format": "ogg"}' \
--output hello.ogg
# MP3 — maximum compatibility
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"text": "Hello", "voice": "M1", "lang": "en", "format": "mp3"}' \
--output hello.mp3import requests
r = requests.post(
"https://audexum.com/api/synthesize",
headers={"Authorization": "Bearer sk_live_..."},
json={"text": "Hello world", "voice": "M1", "lang": "en", "format": "ogg"},
)
r.raise_for_status()
with open("hello.ogg", "wb") as f:
f.write(r.content)
# Content-Type: audio/ogg| format | Content-Type | Codec |
|---|---|---|
| wav | audio/wav | PCM 16-bit, 44,1 kHz (sem transcodificação) |
| mp3 | audio/mpeg | libmp3lame VBR ~192 kbps |
| ogg | audio/ogg | libopus 96 kbps, 48 kHz |
| opus | audio/opus | libopus 96 kbps, 48 kHz (contêiner Ogg) |
TTS em streaming
Adicione "stream": true para receber áudio à medida que ele é gerado. A resposta é um fluxo de transferência em chunks com arquivos WAV concatenados. Cada chunk é um WAV completo e válido (cabeçalho RIFF de 44 bytes + PCM), portanto você pode começar a reproduzi-lo imediatamente. A cota é reservada para todo o texto desde o início, de forma idêntica a uma chamada sem streaming. O streaming exige format=wav (o padrão).
curl -X POST https://audexum.com/api/synthesize \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"text": "Sentence one. Sentence two. Sentence three.", "voice": "M1", "lang": "en", "stream": true}' \
--no-buffer --output - | ffplay -nodisp -i pipe:0import requests
with requests.post(
"https://audexum.com/api/synthesize",
headers={"Authorization": "Bearer sk_live_..."},
json={
"text": "First sentence. Second sentence. Third one.",
"voice": "M1",
"lang": "en",
"stream": True,
},
stream=True,
) as r:
r.raise_for_status()
with open("streamed.wav", "wb") as f:
for chunk in r.iter_content(chunk_size=None):
f.write(chunk)
# Each yielded chunk is a standalone WAV file (header + PCM).
# Concatenating them produces valid gapless audio.wav. A latência do primeiro bloco é registrada no servidor. O cabeçalho de resposta X-Stream: 1 confirma o modo de streaming.POST/api/transcribe
Transcreva fala em texto. Envie o áudio como multipart/form-data. Requer uma chave sem restrições (as chaves de widget são limitadas a /api/synthesize). A cobrança é de 200 créditos por minuto de áudio.
curl -X POST https://audexum.com/api/transcribe \
-H "Authorization: Bearer sk_live_..." \
-F "[email protected]" \
-F "timestamps=true"Campos do formulário
| Campo | Observações |
|---|---|
| audio | Obrigatório. Um arquivo audio/*, de até 25 MB e 600 segundos. |
| timestamps | Booleano opcional. Inclui os tempos de início e fim de cada segmento. |
| vocabulary | Opcional. Até 2000 caracteres de termos do domínio para orientar o reconhecimento. |
| clean / mode | Opcional. Processe a transcrição depois (clean, email, professional, bullets, concise). |
Resposta
{
"text": "Full transcript…",
"duration_s": 12.3,
"transcribe_ms": 480,
"segments": [{ "start": 0.0, "end": 3.2, "text": "…" }],
"raw_text": "…", // present only when a clean/transform mode was requested
"mode": "clean"
}POST/v1/audio/transcriptions
Conversão de fala em texto compatível com OpenAI. Uma ferramenta que permite alterar a URL base da OpenAI pode usar o Audexum definindo-a como https://audexum.com/v1, sem alterações no código. Usa o mesmo mecanismo e a mesma cobrança que /api/transcribe: 200 créditos por minuto de áudio. Envie multipart/form-data.
A autenticação usa a chave Authorization: Bearer sk_live_…. Crie a chave em Configurações do desenvolvedor (é necessário entrar). Use uma chave sk_live_ chave; chaves de widget restritas recebem 403 aqui.
curl https://audexum.com/v1/audio/transcriptions \
-H "Authorization: Bearer sk_live_..." \
-F [email protected] \
-F model=whisper-1 \
-F language=bg \
-F response_format=json
# {"text": "…"}from openai import OpenAI
client = OpenAI(api_key="sk_live_...", base_url="https://audexum.com/v1")
with open("recording.mp3", "rb") as f:
result = client.audio.transcriptions.create(
model="whisper-1",
file=f,
language="bg", # optional; omit to auto-detect
)
print(result.text)Campos do formulário
verbose_json
Segmento início/fim vêm do mecanismo. Os tempos das palavras (timestamp_granularities[]=word) são estimados: a duração de cada segmento é distribuída entre suas palavras conforme o número de caracteres. Eles não são alinhados à força. Cada segmento contém uma palavras chave, vazia a menos que você tenha solicitado palavras.
{
"task": "transcribe",
"language": "bg", // echo of the request; "auto" when omitted
"duration": 12.3,
"text": "Full transcript…",
"segments": [
{ "id": 0, "start": 0.0, "end": 3.2, "text": "…", "words": [] }
]
}Não compatível
POST /v1/audio/translationsretorna 405.- Transcrição por streaming e a API Realtime.
Erros
| Código | Corpo |
|---|---|
| 400 | {"detail": "audio_too_short"} · "no_speech_detected" · "clip_too_long: max 600s per request" |
| 401 | {"detail": "authentication_required"}: missing or invalid key |
| 402 | {"detail": {"error": "insufficient_credits", …}}: full body below |
| 403 | {"detail": "email_not_verified"}: verify the account's email address |
| 405 | {"detail": "Method Not Allowed"}: /v1/audio/translations |
| 413 | {"detail": "audio_too_large"}: file over 25 MB |
| 415 | {"detail": "unsupported_media_type"}: file part is not audio |
// 402 — the balance cannot cover this file
{
"detail": {
"error": "insufficient_credits",
"plan_tier": "free",
"monthly_grant": 250,
"monthly_used": 250,
"pack_credits": 0,
"requested": 41,
"upgrade_url": "/pricing",
"offer": {
"reason": "insufficient_credits",
"headline": "You are out of credits",
"detail": "This request needs 41 credits. …",
"plan": { "tier": "pro", "price_eur": 29, "credits_per_month": 1200000 },
"actions": [
{ "kind": "upgrade", "label": "Upgrade to Pro — €29/mo", "url": "https://audexum.com/r/402" },
{ "kind": "pack", "label": "Buy 250,000 credits — €7", "url": "https://audexum.com/pricing#packs" }
]
}
}
}POST/api/batch
Envie até 50 textos em uma única solicitação. Aguarde a conclusão e baixe um zip.
# submit
curl -X POST https://audexum.com/api/batch \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"texts": ["one", "two"], "voice": "F2", "lang": "en"}'
# poll
curl -H "Authorization: Bearer sk_live_..." \
https://audexum.com/api/batch/$JOB_ID
# download once status=done
curl -H "Authorization: Bearer sk_live_..." \
https://audexum.com/api/batch/$JOB_ID/download -OWebhooks
Configure um endpoint de webhook no seu Configurações do desenvolvedor para receber notificações POST assinadas. Enviamos JSON com um X-Audexum-Signature Cabeçalho. Verifique-o antes de processar.
Formato do payload
{
"event": "quota.warning_80",
"data": {
"monthly_grant": 3000,
"monthly_used": 24000,
"monthly_remaining": 6000,
"overage_enabled": false,
"plan_tier": "free",
"period_end": "2026-06-30"
},
"timestamp": "2026-06-12T14:22:00.000000+00:00"
}Eventos
Verificação da assinatura
Cada entrega inclui X-Audexum-Signature: sha256=<hex>, calculado como HMAC-SHA256 sobre o corpo bruto da solicitação usando o segredo do seu webhook.
import hashlib, hmac
def verify_signature(body: bytes, secret: str, sig_header: str) -> bool:
expected = "sha256=" + hmac.new(
secret.encode(), body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(expected, sig_header)
# In your FastAPI/Flask/Django handler:
# body = await request.body()
# sig = request.headers["X-Audexum-Signature"]
# if not verify_signature(body, WEBHOOK_SECRET, sig):
# return 401# Configure endpoint (session auth — browser only)
curl -X PUT https://audexum.com/api/account/webhook \
-H "Cookie: audexum_session=..." \
-H "X-Requested-With: XMLHttpRequest" \
-H "Content-Type: application/json" \
-d '{"url": "https://your-server.com/webhooks/audexum"}'
# Response contains secret — store it, shown once only.
# Remove endpoint
curl -X DELETE https://audexum.com/api/account/webhook \
-H "Cookie: audexum_session=..." \
-H "X-Requested-With: XMLHttpRequest"Erros
| Código | Significado |
|---|---|
| 400 | Solicitação inválida: voz/idioma inválidos, texto vazio ou stream+formato diferente de wav |
| 401 | Chave de API ausente ou inválida |
| 402 | insufficient_credits: Cota mensal excedida; consulte /api/usage e /pricing para ver as opções de upgrade |
| 402 | feature_gated: O recurso exige um plano superior (consulte error.feature e error.min_tier) |
| 422 | URL de webhook inválida (não HTTPS, IP privado ou impossível de resolver) |
| 429 | Muitas solicitações: reduza a taxa de solicitações e tente novamente |
| 503 | Servidor ocupado (limite de concorrência atingido): tente novamente com backoff exponencial; respeite Retry-After |
Limites de uso e uso justo
- Limite de concorrência compartilhado: solicitações além dele recebem 503 + Retry-After
- Taxas de solicitações abusivas contínuas podem ser limitadas (uso justo)
- Cota mensal de créditos do seu nível de plano
- Fale conosco para obter capacidade dedicada ou PAYG
Com problemas? Envie um e-mail para [email protected].