#Cannot use api_key for openai.Audio.atranscribe

6 messages · Page 1 of 1 (latest)

chrome comet
#

Hello,
I'm trying to use openai.Audio.atranscribe using the official OpenAI library in Python (0.27.2) but I cannot set a "customized" API key for Whisper if openai.api_key is not set.

Code

r = await openai.Audio.atranscribe(
    "whisper-1",
    fp,
    api_key="sk-..."
)```
Output

No API key provided. You can set your API key in code using 'openai.api_key = <API-KEY>', or you can set the environment variable OPENAI_API_KEY=<API-KEY>). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = <PATH>'. You can generate API keys in the OpenAI web interface. See https://onboard.openai.com for details, or email support@openai.com if you have any questions.

serene sedge
#

What if you just set openai.api_key before the call?

#

It's not a very expensive call to make to set the key

chrome comet
serene sedge
#

You can set it back to the original one after the call maybe?

chrome comet