API Documentation

Vocabulary Audio API Reference

Overview

Get R2 URLs for word pronunciation audio

POST words to get their audio URLs. Audio is generated on-demand using Azure Text-to-Speech and cached permanently in Cloudflare R2.

Supported Languages

CodeLanguageVoice
enEnglishen-US-JennyNeural
zh-cnSimplified Chinesezh-CN-XiaoxiaoNeural
zh-twTraditional Chinesezh-TW-HsiaoChenNeural
koKoreanko-KR-SunHiNeural
jaJapaneseja-JP-NanamiNeural

Get Audio URLs

POST/api/audio

Request Body

{
  "lang": "en",
  "words": ["hello", "world"],
  "key": "YOUR_API_KEY"
}
  • lang - Language code (en, zh-cn, zh-tw, ko, ja)
  • words - Single word or array (max 50, each max 100 chars)
  • key - API key (required)

Response

{
  "lang": "en",
  "results": [
    { "word": "hello", "url": "https://r2-domain.com/en/hello.mp3" },
    { "word": "world", "url": "https://r2-domain.com/en/world.mp3" }
  ],
  "requestId": "uuid"
}

Example

curl -X POST "https://vocabulary-audio-service.loveyouall.qzz.io/api/audio" \
  -H "Content-Type: application/json" \
  -d '{"lang":"en","words":["hello","world"],"key":"YOUR_API_KEY"}'

Try It

Test the API directly

Node.js Example

const response = await fetch("https://vocabulary-audio-service.loveyouall.qzz.io/api/audio", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    lang: "en",
    words: ["hello", "world"],
    key: "YOUR_API_KEY"
  })
});

const data = await response.json();
// { lang: "en", results: [{ word: "hello", url: "https://..." }, ...], requestId: "..." }

for (const item of data.results) {
  console.log(`${item.word}: ${item.url}`);
}

Error Responses

StatusCodeDescription
400INVALID_LANGUnsupported language code
400EMPTY_WORDSNo words provided
400TOO_MANY_WORDSExceeds 50 word limit
401UNAUTHORIZEDInvalid or missing API key