Have anyone worked with openai API's ? i am trying...
# ai
y
Have anyone worked with openai API's ? i am trying to transcribe a video in a multiplatform porject
Copy code
private fun transcribeVideo(filePath: String){
    launch {
        try {
            val transcriptionRequest = TranscriptionRequest(
                audio = createFileSource(filePath),
                model = ModelId("whisper-1"),
            )
            OpenaiClient.openaiClient.transcription(
                transcriptionRequest
            ).text.also { println("qcqs $it") }
            
        } catch (e: Exception){
            eventsFlow.emit(HomeEvent.ExceptionHandler(e))
        }
    }
}
i got my openai Instance here
Copy code
object OpenaiClient {
    val openaiClient = OpenAI(
        token = "sk-QXtYdssiI0JErQsdhT3BlbkFJYapzP50lfLFAijnqcqPrA",
        logging = LoggingConfig(LogLevel.All),
    )
}
and i dont seem to understnad why its not working even though that the logging level is set to ALL it just prints an error saying null i just dont know what to do at this point. also it keep bring up this error: *{*"error": *{*"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.", "type": "invalid_request_error", "param": null, "code": null } } Screenshot 2023-12-31 at 2.21.56 PM.png
a
Heeey, you shared your OpenAI key, never do that, anyone can now use it, change it immediately !!
y
its actually not my key its my friend's , nah just kidding its just a fake key thanks tho
😂 2