Continue Chat Conversation
API Documentation: Continue Chat Conversation
Endpoint
Description
This endpoint continues an existing conversation using the provided chat_id
. It works similarly to /v1/chat/completions
, but allows you to maintain conversation context.
Request
cURL Example:
Replace {API_KEY}
with your actual API key and {chat_id}
with the ID of the existing chat session.
Request Body:
messages
: (array) A list of message objects:role
: (string) "user", "system".content
: (string) The text content of the message.
Response
The response will be a JSON object similar to /v1/chat/completions
:
text
: The AI's generated continuation.cost
: The cost incurred for this completion.role
: The role of the response sender (usually "system").chat_id
: The ID of the ongoing conversation.model
: The model used to generate the response.
Notes
This endpoint automatically preserves previous conversation history associated with the
chat_id
.Make sure the
chat_id
provided is valid and was generated by a prior/v1/chat/completions
request.If an invalid
chat_id
is provided, a404 Not Found
error will occur.
Last updated