Question

Help with OpenAI "API Request (Beta)" structure

  • 14 November 2023
  • 6 replies
  • 338 views

Hi. I feel like I’m entering things exactly right, but keep getting errors on the structure, so would love any help.

Here’s a summary of what I have in every field:

HTTP Method: Post

URL: https://api.openai.com/v1/chat/completions

Query string: n/a

Additional request headers: n/a

Body: 
{ "model": "gpt-4-vision-preview", "messages": [ { "role": "user", "content": [ {"type": "text", "text": "What’s in this image?"}, { "type": "image_url", "image_url": { "url": "[URL RETRIEVED ELSEWHERE IN ZAP]" } } ] } ], "max_tokens": 300 }

 

And the error i receive:

body

{ "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null } }

data

error

message

you must provide a model parameter

type

invalid_request_error

param

code


6 replies

Userlevel 7
Badge +14

Hi @Augie 

Good question.

For us to have true context, please post screenshots with how your Zap step is configured.

Hi @Augie 

Good question.

For us to have true context, please post screenshots with how your Zap step is configured.

 

I am also having same issue. 

 

request

method

POST

url

https://api.openai.com/v1/chat/completions

querystring

headers

body

{ "model": "gpt-4-1106-preview", "messages": [ { "role": "assistant", "content": "MY content here" } ] }

body

{ "error": { "message": "you must provide a model parameter", "type": "invalid_request_error", "param": null, "code": null } }

 

 

Userlevel 7
Badge +14

Hi @craftroi 

Probably best to post your own topic with screenshots so it gets proper attention, thanks.

Userlevel 6
Badge +8

Do you get the same error message if you change the model to “gpt-3.5-turbo”?

Hi, under “Additional request headers” type in like shown in the image. 

This should get you to the next step.

Badge

{ "model": "gpt-4o", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "yourContent" } ] }

 

header:

Authorization

(your api key)

Reply