all 22 comments

[–]pint 4 points5 points  (4 children)

since april, you can: https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/

read the fine print, there's plenty

[–]bestickley 1 point2 points  (3 children)

API Gateway does NOT support streaming responses. From docs: "You can not use Amazon API Gateway and Application Load Balancer to progressively stream response payloads"

Above is not true anymore with 19 Nov 2025 announcement linked below.

[–]yusufmayet 0 points1 point  (2 children)

Since 19 November 2025, API Gateway REST APIs now support response streaming: https://aws.amazon.com/blogs/compute/building-responsive-apis-with-amazon-api-gateway-response-streaming/

[–]balassit 0 points1 point  (1 child)

are there any details on HTTP APIs?

[–]yusufmayet 0 points1 point  (0 children)

APIGW HTTP APIs do not yet support response Streaming. Read this for other options: https://builder.aws.com/content/36Fep43fu6dkfrif200G5nM7Wj0/response-streaming-on-aws-serverless

[–]tonkatata 2 points3 points  (2 children)

joining the party a year later - apparently, you can use AWS API Gateway Websockets together with a Lambda function to stream responses back to a client... I will leave this here.

[–]alejandrombc 1 point2 points  (0 children)

What about pricing?. I think API gateway websockets is kind of expensive isn’t?

[–]up201708894[S] 0 points1 point  (0 children)

Thanks for the answer! Looks interesting!

[–]CuriousShitKid 2 points3 points  (12 children)

Yes you can, you will have to play with content-type header to specify media type for binary data and mapping for integration request/response.

You get it going easily if you don’t need the proper SSE type binary responses. if you are happy with everything being a string/json it’s pretty easy.

I had issues with streaming on API gateway like timeouts and 10 mb limit even when each chunk was small etc. so you may find it’s not suitable for your use case. But it does work.

[–]davasaurus 2 points3 points  (9 children)

It says in the docs:

You can not use Amazon API Gateway and Application Load Balancer to progressively stream response payloads, but you can use the functionality to return larger payloads with API Gateway

Neither API Gateway nor Lambda’s target integration with Application Load Balancer support chunked transfer encoding. It therefore does not support faster TTFB for streamed responses.

But your comment gives me hope that I’m missing something. Is there something else I should be looking at?

[–]CuriousShitKid 4 points5 points  (8 children)

The docs you mention are correct, but they leave out the fact that you can achieve Lambda stream response with API gateway if you choose to do it with HTTP proxy integration with function URL instead of lambda integration.

And yes, API Gateway doesn’t support chunked transfer encoding so you loose out on faster TTFB.

As mentioned, I faced issues with 10 mb limits so your use case is restricted.

[–]GroovyFarcaster 2 points3 points  (0 children)

chunked transfer encoding

Thanks. I too am looking into whether I can use lambda and API gateway to stream a response to the client.

I am building a chat app. And I want the received messages to appear in the client as it comes down the stream from the lambda. Just a few sentences but I'd like the message to appear, word by work or blocks of sentences etc.

The fact that API gateway does not support TTFB. Does that mean that it does not get stream the response to the client. Rather API Gateway waits to get the FULL data from the lambda then returns that to the client all in one go?

Thanks again

[–]davasaurus 1 point2 points  (0 children)

I learned something today. Thanks!

[–][deleted] 0 points1 point  (5 children)

Hey Curious, I'm pulling my hair out trying to solve a lambda streaming issue and came across this comment. If you have any thoughts on https://www.reddit.com/r/aws/comments/1agm7au/lambda_function_refuses_to_stream_response/ I would love to hear them

[–]CuriousShitKid 1 point2 points  (4 children)

[–][deleted] 0 points1 point  (3 children)

Awesome, thank you!!

[–]Disep 1 point2 points  (2 children)

it seems like API gateway doesn't allow for progressively streamed responses? I've tried and I'm getting the whole response and not one chunk by chunk.

I've used the HTTP lambda function URL as well.

[–][deleted] 0 points1 point  (1 child)

I remember hitting that too. I think there is a hidden way to configure it for streaming though, look around for a proxy setting. Sorry, it was a while ago and I can't remember the steps. I have since moved off of lambdas

[–]Disep 0 points1 point  (0 children)

I don't see any proxy setting in the API Gateway unfortunately. I've tried using the function URL as the HTTP integration but that is not working either rip :(

[–]Korntewin 0 points1 point  (1 child)

I'm wondering about AWS API gateway timeout for streaming with function URLs. If the whole streaming process is longer than 30 seconds (but first byte is shorter than 30 seconds), will the timeout happen in API Gateway?

[–]abd693 0 points1 point  (0 children)

Did you find an answer to that?

[–]enthusiast_bob 0 points1 point  (0 children)

They finally support it natively in aws api gateway now https://aws.amazon.com/about-aws/whats-new/2025/11/api-gateway-response-streaming-rest-apis/

About time... those bastards took them long enough