Async Audio Jobs
هذا المحتوى غير متوفر بلغتك بعد.
Creating a Job
curl https://ghostmind.optdmsa.com/v1/audio/generations \ -H "Authorization: Bearer gmk_live_..." \ -H "Content-Type: application/json" \ -d '{ "input": "Hello, world!", "voice": "ar-MA-Standard-A" }'Response (200):
{ "id": "job-uuid", "status": "queued"}Timing: the upstream provider is browser-automation based — expect roughly 1–2 minutes per clip. Poll every 2–5 s; do not block a latency-sensitive request path on TTS.
Expiry: generated audio expires 24 hours after job creation — download and store the file on your side promptly.
Polling for Completion
import timeimport requests
job_id = "job-uuid"while True: response = requests.get( f"https://ghostmind.optdmsa.com/v1/audio/generations/{job_id}", headers={"Authorization": "Bearer gmk_live_..."}, ) job = response.json() if job["status"] == "completed": break elif job["status"] == "failed": raise Exception(f"Job failed: {job.get('error_message')}") time.sleep(2)Downloading Audio
curl https://ghostmind.optdmsa.com/v1/audio/generations/{job_id}/content \ -H "Authorization: Bearer gmk_live_..." \ -o audio.wavNext Steps
- Audio Generation API — API reference
- Speech Generation Guide — User guide