# Generate the next message in a conversation

> Generates the next message using the specified actor's linked agent or chat.

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Generate the next message in a conversation"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/conversations/{conversation_id}/generate"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Generates the next message using the specified actor's linked agent or chat.
Background by default: returns `202 Accepted` immediately and the reply
lands as a new ConversationMessage when it completes — poll
`GET /api/v1/conversations/{conversation_id}/messages` for it.
Pass `?wait=true` to block and receive the result inline. On
`completed`, the reply is persisted as a new ConversationMessage
authored by that actor. On `requires_action`, nothing is persisted; the
caller must submit tool outputs via the Agents module and re-invoke
generate — so a flow using client tools should pass `?wait=true`.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
  {...require("./generate-conversation-message.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./generate-conversation-message.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./generate-conversation-message.StatusCodes.json")}
>
  
</StatusCodes>
