Packages

@ai-sdk/gateway

4.0.150 · 18 Nov 2026Apache-2.047.3M / weekRepositoryHomepagenpmAtom feed

Your version

4.0.136

5 Nov 2026Where it was published

4.0.152 is the newest release of 4.x.

In short

4 new1 faster1 fixed12 internal

Release note

Patch Changes

  • Add opt-in streaming decoding of large generated images to reduce peak memory.

    Set providerOptions.gateway.experimental_streamingImageDecoding to true to decode canonical base64 images of at least 64 KiB while reading the response. Extracted images are returned as Uint8Array; smaller images stay base64 strings, and mixed results are normalized to bytes. The client option is not forwarded to the service.

    Default behavior preserves the API's base64 representation. Opting in changes the model result representation and replaces large image data with placeholders in validation errors. Accessing GeneratedFile.base64 can require re-encoding the extracted bytes.

  • Preserve optional normalized word timings returned by transcription responses and warn when shared timestampGranularities requests are not forwarded by the gateway adapter.

  • Accept explicit uploaded-video outcomes in video generation and status responses.

  • Pass through seed: 0 instead of dropping it in image and video models. KlingAI now reports seed: 0 as an unsupported setting like any other seed.

  • Feat (provider/gateway): implement server-side realtime connection descriptors

    GatewayRealtimeModel now implements getServerWebSocketConfig(), returning the AI Gateway realtime WebSocket URL plus Authorization header auth and optional team scoping for trusted server-side clients. Unsupported endpoint intents are rejected on the normalized realtime route.

    Server WebSockets reuse HTTP authentication, protocol, team and custom headers, including OIDC auth-method metadata.

  • Add marketCost, surchargeCost, and gatewayCost fields to getGenerationInfo() results, surfacing the corresponding fields from the AI Gateway generation lookup API.

    The cost breakdown fields are optional and omitted when unavailable, preserving compatibility with older responses and distinguishing missing data from a zero cost.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.