Audio transcription supported on last version of openAI

Hi,
I convert audio files to text file with open ai dependency in python.
But this feature seems to be supported only on version 0.28. Does the current version of lib like 1.8.0 or newer one supported this feature?

Thanks

Yes, WhisperAPI supports speech-to-text transcription and can be used with the OpenAI module version 1.8.0 or newer. There have been some changes in importing the module and creating an instance.

from openai import OpenAI
client = OpenAI()

response = client.audio.transcriptions.create(
    audio=audio_file,
    model="whisper-1",
    language="en",
    temparature=0,
    response_format="text",
)
transcription = response.text

By following the steps above, everything should work properly.
In the code provided, the API key is automatically obtained from the environment variables.

1 Like

Many thanks.
It’s worked well!