Skip to content

embeddings and audio ​

embeddings and audio API are suitable for semantic search, text-to-speech, audio transcription and audio translation. They continue to use a uniform authentication method:

http
Authorization: Bearer <MOONNEXAI_API_KEY>

Text embeddings ​

http
POST /v1/embeddings
bash
curl https://moonnexai.com/v1/embeddings \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "moonnexai-embedding",
    "input": "MoonNexAI developer documentation"
  }'

Text transcribing ​

http
POST /v1/audio/speech
bash
curl https://moonnexai.com/v1/audio/speech \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "tts-1",
    "input": "Welcome to MoonNexAI.",
    "voice": "alloy",
    "response_format": "mp3"
  }'

Audio transcription ​

http
POST /v1/audio/transcriptions
bash
curl https://moonnexai.com/v1/audio/transcriptions \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -F "file=@./speech.mp3" \
  -F "model=whisper-1"

Audio translation ​

http
POST /v1/audio/translations
bash
curl https://moonnexai.com/v1/audio/translations \
  -H "Authorization: Bearer <MOONNEXAI_API_KEY>" \
  -F "file=@./speech.mp3" \
  -F "model=whisper-1"

Common field ​

fieldApplication APIAnnotations
modelAllModel name.
inputembeddings, text transjectEnter the text.
filetranscription, translationAudio file.
voiceText to speechVoice name.
response_formatText transcribingOutput format, e.g. mp3.

Relevant Pages ​