API Reference

Audio

Use speech generation, audio transcription and audio translation APIs.

Audio APIs include speech generation, transcription and translation. Speech generation uses a JSON request body; transcription and translation usually use multipart form data to upload the audio file.

Endpoints

MethodPathDescription
POST/v1/audio/speechText to speech
POST/v1/audio/transcriptionsAudio transcription
POST/v1/audio/translationsAudio translation

Request Fields

FieldTypeApplies ToDescription
modelstringAllAudio model ID, required
inputstringspeechText to synthesize
voicestringspeechVoice ID
instructionsstringspeechVoice style or extra instructions
response_formatstringAllResponse format. Transcription and translation default to json
speednumberspeechSpeech speed
stream_formatstringspeechSet to sse to enable streaming when the model supports it
metadataobjectspeechPass-through metadata
filefiletranscriptions/translationsAudio file in multipart form data, required
languageanyextensionLanguage option supported by some channels

Speech Generation

curl https://api.tensoraxis.ai/v1/audio/speech \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -d '{
    "model": "tts-1",
    "voice": "alloy",
    "input": "Hello from TENSORAXIS.",
    "response_format": "mp3"
  }' \
  --output speech.mp3

Transcription

curl https://api.tensoraxis.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3" \
  -F response_format="json"

Translation

curl https://api.tensoraxis.ai/v1/audio/translations \
  -H "Authorization: Bearer $TENSORAXIS_API_KEY" \
  -F model="whisper-1" \
  -F file="@audio.mp3" \
  -F response_format="json"

Response Shape

JSON transcription and translation responses usually include text:

{
  "text": "Transcribed text..."
}

Speech generation returns binary audio directly. The response Content-Type depends on response_format and the upstream model.