v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1433660423.8 KB

Queries a knowledge base and generates responses based on the retrieved results, with output in streaming format.

This API cannot be used with managed knowledge bases. Use AgenticRetrieveStream or Retrieve with managed knowledge bases.

The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream.

This operation requires permission for the bedrock:RetrieveAndGenerate action.

post/retrieveAndGenerateStream

Request body

sessionIdstring

The unique identifier of the session. When you first make a <code>RetrieveAndGenerate</code> request, Amazon Bedrock automatically generates this value. You must reuse this value for all subsequent requests in the same conversational session. This value allows Amazon Bedrock to maintain context and knowledge from previous interactions. You can't explicitly set the <code>sessionId</code> yourself.

Response

Success