Open API
Plug “audio → subtitles” into your own system: ERP, listing tools, and agency back offices can all call it directly. Billing shares the same credit wallet as the web app, with no separate ledger.
Want an API key?
Keys are tied to your account, so issuing, viewing, and revoking all require a login. Managing a key with the key itself would mean one leaked key could renew itself indefinitely.
Quick start
1. Authentication: put the key in the request header
curl https://smilesub.xixiaotech.cn/api/v1/me \ -H "Authorization: Bearer sk_live_your_api_key" # Also fine (a style many gateways accept): # -H "X-API-Key: sk_live_your_api_key"Passing the key as a URL parameter is not supported: URLs end up in access logs, browser history, and the Referer header, and a long-lived key that shows up in a log is a leak.
2. Typical flow (audio → subtitles → download)
# ① Upload the audio and create a task (note: Content-Length is required — the body is raw binary, not multipart) curl -X POST "https://smilesub.xixiaotech.cn/api/v1/subtitles?language=zh" \ -H "Authorization: Bearer sk_live_your_api_key" \ -H "Content-Type: audio/wav" \ -H "X-Filename: product-intro.wav" \ --data-binary @audio.wav # → { "success": true, "data": { "file_id": "…", "status": "queued", "credits_charged": 30 } } # ② Poll the status until has_subtitles is true curl "https://smilesub.xixiaotech.cn/api/v1/tasks/FILE_ID" \ -H "Authorization: Bearer sk_live_your_api_key" # ③ Download the subtitles (srt/vtt/txt are free; ass and bilingual are billed per export) curl -o out.srt "https://smilesub.xixiaotech.cn/api/v1/tasks/FILE_ID/export?format=srt" \ -H "Authorization: Bearer sk_live_your_api_key"Extract the audio yourself with ffmpeg first, then upload it (
ffmpeg -i in.mp4 -vn -ac 1 -ar 16000 out.wav). That is exactly what the web app does too — the server normally never handles the full video.3. Synchronous translation (several languages in one request)
curl -X POST https://smilesub.xixiaotech.cn/api/v1/translate \ -H "Authorization: Bearer sk_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "srt": "1\n00:00:00,000 --> 00:00:03,000\nHello\n", "source_language": "en", "target_languages": ["ja", "ko"], "output": "srt" }' # → { "success": true, "data": { "translations": { "ja": { "content": "…" }, "ko": { "content": "…" } }, # "credits_charged": 6, "balance_after": 994 } }
Endpoints
Billing, error codes, and limits
Billing rules (the same price list as the web app)
- Subtitle generation: — credits / minute (rounded up)
- Subtitle translation: — credits / minute / per target language
- Bilingual export: — credits / time
- Styled ASS export: — credits / time
- Source subtitle export (srt / vtt / txt): Free
- Creator subscription — monthly / quarterly / yearly — while it is active, both enhanced exports are waived
Error codes
401 API_KEY_MISSING / API_KEY_INVALIDKey missing or invalid402 INSUFFICIENT_CREDITSNot enough credits (time to top up)403 API_DISABLED / SCOPE_REQUIREDAPI is off / the key lacks the required scope404 TASK_NOT_FOUNDTask does not exist or is not yours409 SUBTITLES_NOT_READYSubtitles have not finished generating yet413 FILE_TOO_LARGEThe file exceeds the size limit429 QUOTA_EXCEEDEDQuota exceeded (the response carries Retry-After)
Limits: up to — MB per file; up to 2000 cues per translation. Quotas are counted per key and reset daily at 00:00 UTC.