What’s your system prompt look like? And your user/assistant prompts? What settings are you using?
We don’t know for sure the settings for ChatGPT - or the system message used - which can make it difficult to replicate exactly, but if ChatGPT can handle it, there’s a good chance you can do it with the API too with a little work.