ich habe eine Problem bei einem Key. Ich rede über diese Webseite: https://beta.openai.com/playground/p/
Die Gründer dieser Webseite sind so freundlich gewesen einen Code zur eigenen Nutzung zur Verfügung zu stellen:
Code: Alles auswählen
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="",
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
Code: Alles auswählen
Exception has occurred: AuthenticationError
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.
File "/home/peerpri/Python/AI/AiTest1.py", line 6, in <module>
response = openai.Completion.create(
Code: Alles auswählen
import os
import openai
openai.api_key = os.getenv("sk-gkvLOV5eo17PaBS4OT3lbkFJIiIMGkrlQnwifYA")
response = openai.Completion.create(
model="text-davinci-003",
prompt="",
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
Code: Alles auswählen
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.
File "/home/peerpri/Python/AI/AiTest1.py", line 5, in <module>
response = openai.Completion.create(
Bitte helft mir. Danke für jegliche Bemühungen.
Lg