Multi-turn conversations enable you to build chat experiences where the model can refer to and respond within the context of previous messages, instead of treating every request as a new conversation. The Chat Completions API is stateless by design: it does not automatically retain any memory or context of earlier requests. To continue a conversation, resend the full conversation history with each request. Your application is responsible for managing that history and including the relevant messages.
How conversations work
A conversation is represented as a list of messages. Each message has arole and content.
Common roles include:
user: Contains a message from the user.assistant: Contains a previous response from the model.
Continue a conversation
Python
The following example sends two requests:- The original user request.
- The assistant’s response.
- The user’s follow-up request.
cURL
With cURL, you can achieve the same result by sending the conversation history in themessages array.
Streaming
To use multi-turn conversations with streaming, send the conversation history inmessages and set stream: true in your request. As the response arrives, collect the assistant’s text and append the completed response to the conversation history before sending the next turn.
See Streaming for details on handling streamed responses.

