Making POST request to OpenAI API.

Hello everyone! I’m new to Plasmic and would appreciate some help on how to make a POST request. In this case, I’m trying to send a request to the OpenAI API, specifically to the chat completion endpoint. I’m not sure if I’m setting up the request body correctly, as I’m using the “raw” option to add a nested JSON. In the “Json” option, I’m not sure how to define this JSON. Also, I want to mention that I include the token and content type in the generated configuration of the REST API. When I try to make the request, I get an internal server error. Am I doing something wrong? Could you guide me on how to make this request correctly?
Thank you!


Hello @clear_bedbug! You can open our dynamic expressions editor by typing {{ or by clicking on the small green circle on the top right of the input. Can you try changing your current Raw input to have an object from our dynamic expressions editor and see if it helps? You might be trying to submit a string instead of a object in this case.

Hello @icaro, thank you for your response. I think I’m still not doing something right. I’ve tried to add the object to the dynamic expression code editor as shown in the following image, and it still gives me the same error.