# Trigger agent generation

> Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` immediately while the generation runs. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Trigger agent generation"}
>
</Heading>

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

Triggers the agent to generate a response based on the current conversation. Background by default: returns `202 Accepted` immediately while the generation runs. Pass ?wait=true to block and receive the assistant reply (or a requires_action status if the agent needs client tool outputs) in the response.

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

<ParamsDetails
  {...require("./generate-session-response.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./generate-session-response.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./generate-session-response.StatusCodes.json")}
>
  
</StatusCodes>
