🔌 API Documentation
Base URL: https://yum.cutdee.com · Phase 2: public submit + 30/min rate limit · Download OpenAPI 3 spec (130 KB)
⚡ Quickstart
$ curl -X POST https://yum.cutdee.com/api/tts \
-H "X-API-Key: vgpu_live_..." \
-H "Content-Type: application/json" \
-d '{"text":"สวัสดี","voice":"thai_female_1"}' \
--output hello.wav
📋 Endpoints
POST/api/tts — สร้างเสียง (sync)
Returns: audio/wav · Rate limit: 30/min (public) · 360/min (api_key)
curl -X POST https://yum.cutdee.com/api/tts \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "สวัสดีครับ",
"voice": "thai_female_1",
"mode": "auto",
"format": "wav",
"consent_confirmed": true
}' \
--output out.wav
▶ ดู Python / JS / ลองเลย
import httpx
r = httpx.post(
'https://yum.cutdee.com/api/tts',
headers={'X-API-Key': 'YOUR_KEY'},
json={'text':'สวัสดี','voice':'thai_female_1','mode':'auto','consent_confirmed':True}
)
with open('out.wav','wb') as f: f.write(r.content)
const r = await fetch('https://yum.cutdee.com/api/tts', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'สวัสดี', voice: 'thai_female_1', mode: 'auto', consent_confirmed: true })
});
const blob = await r.blob();
const url = URL.createObjectURL(blob);
new Audio(url).play();
POST/api/web/jobs/tts — async job
Returns: {job_id, job_token, job_token_expires_unix, rate_limit} · แล้ว poll GET /api/web/jobs/{id} with X-Job-Token header
$ curl -X POST https://yum.cutdee.com/api/web/jobs/tts \
-F "text=สวัสดี" \
-F "voice=thai_female_1" \
-F "mode=auto" \
-F "consent_confirmed=true"
{"ok":true,"job_id":"7cbc096a...","job_token":"eyJ2Ij...","job_token_expires_unix":1781448151,"rate_limit":{"remaining":359,...}}
💡 UI v2 เก็บ job_token ใน localStorage อัตโนมัติ และส่ง header X-Job-Token ตอน poll
POST/api/reference/validate — validate ref audio
Returns: {ok, passed, audio: {duration, sample_rate, channels}, warnings: []} · ตรวจ 3-10s mono ≥16kHz
$ curl -X POST https://yum.cutdee.com/api/reference/validate \
-H "X-API-Key: YOUR_KEY" \
-F "ref_audio=@sample.wav"
{"ok":true,"passed":true,"reference_guideline":{"min_sec":3.0,"max_sec":10.0},"audio":{"suffix":".wav","duration_sec":5.2,"sample_rate":24000,"channels":1}}
POST/api/reference/transcribe — ASR for ref audio
Returns: {text, language, confidence}
$ curl -X POST https://yum.cutdee.com/api/reference/transcribe \
-H "X-API-Key: YOUR_KEY" \
-F "ref_audio=@sample.wav"
{"text":"สวัสดีครับ","language":"th","confidence":0.96}
GET/api/capabilities — list capabilities
Returns: {modes, voices, model, features, ...} — ไม่ต้อง auth
$ curl https://yum.cutdee.com/api/capabilities
GET/api/health — health check
Returns: {ok, ready, ready_since, model, mode, startup_warmup}
$ curl https://yum.cutdee.com/api/health
{"ok":true,"ready":true,"ready_since":"2026-06-14T19:41:16+07:00","service":"omnivoice-webapp","mode":"real","model":"k2-fsa/OmniVoice"}
GET/api/openapi/export?format=json — full OpenAPI 3 spec
130 KB · 60+ endpoints · 📥 Download JSON
🔐 Auth & Rate Limits (Phase 2)
3 วิธี authenticate
| วิธี | Header | Rate limit | Use case |
|---|---|---|---|
api_key | X-API-Key: vgpu_live_... | 360/min (api_key profile) | Production app, dev |
turnstile | cookie + form | 30/min (turnstile profile) | ผู้ใช้ทั่วไปผ่าน web |
studio | X-Studio-Token: ... | 8/min (studio profile) | Studio portal (admin) |
💡 Default mode = api_key_or_turnstile — รับ api_key หรือ turnstile fallback ก็ได้
📚 เอกสารเพิ่มเติม
🔗 ลิงก์ที่เกี่ยวข้อง
🧪 ทดสอบ API
ลอง เสียงสำเร็จรูป หรือ โคลนเสียง แบบ UI ได้เลย