Opens in a new tab
News

Google API Gateway adds streaming for LLM responses

In brief

Google API Gateway’s streaming preview delivers response chunks while a model is still generating. Creation-time settings and request deadlines shape the migration.

3 min read

Sources
Coral tiles pass through a blue arch into a partly assembled ivory shape whose final recess is still empty.
Conceptual illustration of incremental delivery before a complete response is available. Streaming does not make the model generate faster or guarantee completion before gateway and backend deadlines.
On this page2 sections

A user watching an LLM answer appear a few words at a time can begin reading before generation finishes. Put a buffering gateway in that path, and the user may instead wait for the whole answer. Google Cloud API Gateway’s Public Preview, listed in the September 29 release notes, addresses that delivery delay with incremental HTTP responses, Server-Sent Events, WebSockets and bidirectional gRPC.

The change moves the beginning of the reading experience earlier; it does not make the model generate faster. That distinction gives a trial its two clocks: time until useful output reaches the client, and time until a complete answer arrives. The second clock becomes especially important when deadlines interrupt an otherwise promising stream.

The migration starts with a new gateway

Streaming is selected at gateway creation with --enable-streaming, and the output-only effectiveStreamingMode field reports the resulting mode. Google does not allow that mode to be changed on an existing gateway. For an established endpoint, trying the feature therefore means planning replacement or traffic migration rather than treating streaming as an in-place switch.

The streaming configuration guide adds a detail that can decide whether the trial works: HTTP streaming, including Server-Sent Events (SSE), defaults to a 15-second request deadline, although streaming-enabled gateways support up to 3,600 seconds. The backend has its own timeout. Extending one deadline while leaving the other too short still leaves a path that can cut an answer off. Preview status also brings pre-GA terms and potentially limited support, making the choice of trial endpoint consequential.

A model sends successive chunks through a streaming gateway to a client. First output and completed response are measured separately; gateway and backend deadlines both apply.
Conceptual response path. Earlier visible output and successful completion answer different performance questions.

Earlier output and interrupted answers

Consider a hypothetical incident assistant that needs 25 seconds to assemble an answer from collected service evidence. Streaming might expose useful text well before then, so the interface feels responsive. But if an earlier deadline closes the request, the same user receives only part of the answer. A first-output chart could improve while the service becomes less successful at delivering the thing people asked for.

Compare the buffered and streaming paths under the same prompts, model settings and concurrent request demand, counting completed and interrupted answers alongside first output. Holding the offered workload constant makes the comparison interpretable: earlier text is an improvement only in the context of how much of the requested work still finishes. Otherwise a path that abandons difficult requests can look deceptively quick.

Include a slow backend and a client that disconnects, then follow each through the display, backend work and completion signal. These are proposed trial cases, not Google benchmark results. They also expose where streaming may have less value: a consumer that must validate a complete object before acting still waits for completion, even if it can display progress sooner.

A separate gateway with a preserved route back lets an existing production service explore the preview without making the first experiment its only delivery path. Keep incomplete application responses and gateway errors beside the latency measurements. The guide to reading distributed traces helps separate time in the gateway from the work behind it, so the team can say precisely what streaming improved and what remains to finish.

Sources & context

Sources linked in this article. Read alongside the author’s analysis; a citation does not independently verify a publisher’s claims.

Report an error or outdated detail

More on Google

All Google coverage

Related reading

Explore a related question