Context in dialog

hello everyone, I’m creating a test and I see that calling the api it does not maintain the context of the conversation. I’m developing in javascript could someone give me a way to solve this?

I don’t recall where I learnt it, but I am pretty sure that, unlike ChatGPT, the models available via the API have no memory.

However, to contradict me, the playground for the API has a chat example. And it’s not obvious how this works. I have seen other people ask how but I have not see an answer.

the context has to be part of the prompt