Hi everyone,
I'm trying to automate the following flow using Zapier:
-
Google Sheet triggers a Zap when a new row is added.
-
I want to send a prompt from this row to OpenAI's
chat/completions
endpoint using GPT-4 Turbo. -
Then I want to store the OpenAI output back into Google Sheets.
Here's what I've done so far:
-
Step 1: Google Sheets trigger (New or Updated Row)
-
Step 2: Filter (only if column "Traitée ?" = "Non")
-
Step 3: (Optional) Code by Zapier step to construct a JSON payload
-
Step 4: Webhooks by Zapier (Custom Request) to call
https://api.openai.com/v1/chat/completions
In the Webhook, I configured:
-
Method: POST
-
Payload Type: RAW
-
Headers: Authorization: Bearer
sk-XYZW...
, Content-Type: application/json -
Data: the JSON payload stringified (full payload with model, messages, temperatures, etc.)
Now, the problem : Each time I test, OpenAI returns the error: "you must provide a model parameter". Even when I send a hardcoded valid JSON body…
I still get the same error message.
The Authorization header is correct. The URL is correct. Payload Type is RAW. Data is pasted directly as JSON with no wrapping field. No Basic Auth, no extra fields….
I’m lost. I need to dynamically pull the prompt from Google Sheets.
Has anyone successfully sent a proper chat/completions request to OpenAI using Webhooks by Zapier? If yes, could you please share your configuration (Webhook settings, Payload format)? (How do you ensure the model field is properly received?)
Thank you very much