我尝试对GPT-3进行API调用,但遇到错误(错误请求400)。以下是我的代码:
url = "https://api.openai.com/v1/engines/gpt-3/jobs"
headers = {
"Content-Type": "application/json",
"Authorization": "sk-apikey"
}
data = {
"model": "text-davinci-002",
"prompt": "Correct this to standard English : Who are you",
"max_tokens": 60
}
response = requests.post(url, headers=headers, data=json.dumps(data))
1条答案
按热度按时间wj8zmpe11#
请尝试更改URL并修复Authorization标头...