How to Resolve Invalid Request Issue when Integrating OpenAI with Zendesk?

I think you might be right, it feels like a bug in that action. If I POST your same payload in a nodejs step (or via curl) it works fine. For example:

import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    openai: {
      type: "app",
      app: "openai",
    }
  },
  async run({steps, $}) {
    const body = 
    {
      "model": "gpt-3.5-turbo",
      "messages": [
        {
          "role": "system",
          "content": "You are a helpful customer support assistant integrated into Zendesk. Provide internal notes to help agents respond to tickets effectively."
        },
        {
          "role": "user",
          "content": `Here is a new ticket that needs analysis and a suggested response:\n\nTicket Title: ${steps.trigger.event.title}\nTicket Description: ${steps.trigger.event.description}\nRequester: ${steps.trigger.event.requester}\nStatus: ${steps.trigger.event.status}\nTicket URL: ${steps.trigger.event.url}\n\nBased on this information, suggest a concise and actionable internal note for the agent. If additional resources (knowledge base articles or macros) should be created, include that suggestion.`
        }
      ],
      "temperature": 0.7,
      "max_tokens": 200
    }
    return await axios($, {
      url: `https://api.openai.com/v1/chat/completions`,
      headers: {
        Authorization: `Bearer ${this.openai.$auth.api_key}`,
      },
      method: 'post',
      data: body
    })
  },
})

Oh hang on, need to adjust those step references, will edit that message

Does that pre-built Chat action work for you? Just wondering why you built out the step manually instead of using the pre-built action.

On the road now but will try that, thank you!

Hm actually it has something to do with the {{ }} step reference notation in the body. If I remove those, your original request works. That’s confusing though, since those should be getting interpolated correctly before sending the OpenAI.

Interesting, will give that a go when I get back on