Hello community,
I want to use java or kotlin code for the Transcribe API. The only available I see here is Python, node and curl.
I am trying to use Retrofit with the below code:
fun transcribeAudio(audioFile: File): String {
val audioRequestBody = audioFile.asRequestBody("audio/*".toMediaType())
val request = Request.Builder()
.url("https://api.openai.com/v1/audio/transcriptions")
.header("Authorization", "Bearer API_KEY")
.post(audioRequestBody)
return client.newCall(request.build()).execute().use { response ->
response.body?.string() ?: ""
}
}
but I do not know how can I also send the model “whisper-1” at the request? Whatever combination I have tried I am getting an error from the API.
Thanks