Which API Gateway setup streams Bedrock responses with least operational overhead?
A company is designing an API for a generative AI (GenAI) application that uses a foundation model (FM) that is hosted on a managed model service. The API must stream responses to reduce latency, enforce token limits to manage compute resource usage, and implement retry logic to handle model timeouts and partial responses. Which solution will meet these requirements with the LEAST operational overhead?
Community Insight
Tests whether you know native Lambda response streaming through API Gateway requires a REST API, not an HTTP API, despite the HTTP API’s lower baseline overhead.
This scenario compares API Gateway HTTP, REST, and WebSocket patterns for streaming Amazon Bedrock responses while enforcing token limits and retries. The least-overhead design uses an API Gateway REST API integrated with a Lambda function that streams responses.
Selecting A because HTTP APIs are cheaper and lower-latency by default, overlooking that HTTP APIs do not natively support Lambda response streaming to clients.
Community Discussion (13 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option D aligns with the current AWS capability: an API Gateway REST API can use a Lambda proxy integration with response streaming, so the Lambda function can invoke Amazon Bedrock and progressively return the model output. Token limits can be enforced inside the Lambda function before and during the Bedrock invocation, and retry logic for timeouts or partial responses can run in the same function with API Gateway timeout settings as a backstop. This design avoids container orchestration, WebSocket session management, or client-side polling, so it has the least operational overhead among the streaming-capable choices. It also keeps token enforcement and retry behavior server-side, where it can be trusted.Why the Other Options Are Wrong
Option A is close but uses an HTTP API; HTTP APIs do not natively support Lambda response streaming to the client, so achieving progressive delivery would require an additional Function URL proxy or similar workaround that adds configuration. Option B does not stream at all: direct HTTP API integration with Bedrock plus client-side polling and frontend token limits is inefficient and insecure, and polling is not the required low-latency streaming design. Option C uses WebSocket APIs and an ECS-hosted inference server, which introduces container task lifecycle management, scaling, restart policies, and WebSocket state handling—far more operational overhead. Option B also improperly enforces token limits on the frontend, which cannot reliably manage compute usage.Community Comment Notes
Wardove pointed to the November 2025 AWS announcement that response streaming is supported for REST APIs, which is the decisive detail. attila9778 and Kimzia both noted that HTTP APIs do not support streaming while REST APIs support progressive delivery, and Kraftzman added that an HTTP API solution would need a Lambda Function URL proxy, adding configuration. Some learners initially chose A because HTTP APIs are generally cheaper and lower-latency, but that general advantage does not satisfy the native streaming requirement in this question.Official Reference
Exam Strategy
When LEAST operational overhead appears, first eliminate options that add container lifecycle or WebSocket state management. Then verify the exact managed-service feature: API Gateway REST APIs support Lambda response streaming, while HTTP APIs do not natively, so the cheaper HTTP API is not automatically correct.
Frequently Asked Questions
Why is an API Gateway HTTP API not the best choice for streaming here?
HTTP APIs do not natively support Lambda response streaming, so you would need a Lambda Function URL proxy or similar workaround, which adds configuration and overhead.
Does Amazon API Gateway REST API support Lambda response streaming?
Yes. AWS added REST API response streaming, enabling a streaming Lambda integration to deliver Amazon Bedrock output progressively to the client.
Related Analysis
Practice All AIP-C01 Questions
Access 110 questions with complete answers and detailed explanations.
View Full AIP-C01 Practice Test →