Receive (you must provide a model parameter) from completions endpoint

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)

This API method is a POST method, not a GET method.

:slight_smile:

https://platform.openai.com/docs/api-reference/completions/create

1 Like

Thanks @ruby_coder I just released that after I posted the question :woozy_face: