UPDATE: No issue here, messed with the method only
I’m trying to make a simple HTTP request to call the completions endpoint but I’m always getting the error you must provide a model parameter
I’m using python, and here is my script below:
import requests
import json
url = "https://api.openai.com/v1/completions"
payload = json.dumps({
"model": "text-davinci-003",
"prompt": "Say this is a test",
"temperature": 0,
"max_tokens": 7
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer API Key'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)