Hi! I’m trying to use the OpenAI API but keep getting this error message:
There was an issue setting up your call.
Raw response for the API
Status code 400
{
“error”: {
“message”: “Unrecognized request argument supplied: messages”,
“type”: “invalid_request_error”,
“param”: null,
“code”: null
}
}
Make sure your <prompt> is formatted json safe. If there are line breaks that aren’t json safe you’ll get this error (for instance users submitting two paragraphs separated by a space- that won’t work unless you format as json safe. If you’re combining multiple strings of json safe data, I’ve found that doing a find/replace to remove the individual “” and then wrapping the whole appended string in “” works well
I’ve done now. Looks a little different but I got mine from OpenAI API documentation so it should be the latest version? Not sure what is wrong with it.