Langsung ke konten utama
POST
/
v1
/
audio
/
speech
curl --request POST \
  --url https://api.apimart.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumps over the lazy dog.",
    "voice": "alloy",
    "response_format": "opus",
    "speed": 1.0
  }' \
  --output speech.opus
Binary audio data stream

Documentation Index

Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt

Use this file to discover all available pages before exploring further.

curl --request POST \
  --url https://api.apimart.ai/v1/audio/speech \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "gpt-4o-mini-tts",
    "input": "The quick brown fox jumps over the lazy dog.",
    "voice": "alloy",
    "response_format": "opus",
    "speed": 1.0
  }' \
  --output speech.opus
Binary audio data stream

Otorisasi

Authorization
string
wajib
Semua API memerlukan autentikasi Bearer TokenDapatkan API Key:Visit Halaman Manajemen API Key untuk mendapatkan API Key AndaTambahkan ke header request:
Authorization: Bearer YOUR_API_KEY

Body

model
string
default:"gpt-4o-mini-tts"
wajib
Nama model TTSModel yang tersedia:
  • gpt-4o-mini-tts - GPT-4o Mini TTS model
Contoh: "gpt-4o-mini-tts"
input
string
wajib
Teks yang akan dikonversi menjadi suaraPanjang maksimum: 4096 karakterContoh: "The quick brown fox jumps over the lazy dog."
voice
string
wajib
Pilihan suaraSuara yang tersedia:
  • alloy - Suara netral dan seimbang
  • echo - Suara pria yang tenang
  • fable - Suara naratif beraksen Inggris
  • onyx - Suara pria yang dalam
  • nova - Suara wanita yang energik
  • shimmer - Suara wanita yang lembut
Contoh: "alloy"
response_format
string
default:"wav"
wajib
Format output audioFormat yang didukung:
  • wav - Format WAV, tanpa kompresi (default)
  • opus - Format Opus, untuk streaming internet
  • aac - AAC format
  • flac - Format FLAC, kompresi lossless
  • pcm - Format PCM, data audio mentah
Contoh: "wav"
speed
number
default:"1.0"
Kecepatan pemutaran suaraRentang: 0,25 hingga 4,0
  • 0.25 - Kecepatan paling lambat (1/4x)
  • 1.0 - Kecepatan normal (default)
  • 4.0 - Kecepatan paling cepat (4x)
Contoh: 1.0

Response

Jika berhasil, mengembalikan stream data audio biner yang dapat disimpan sebagai file audio atau diputar langsung. Jika terjadi error, mengembalikan informasi error berformat JSON, termasuk kode, pesan, dan jenis error.