Skip to content

Backport: add caching provider option to GatewayProviderOptions#16483

Merged
gr2m merged 2 commits into
release-v6.0from
backport-gateway-caching-v6
Jun 29, 2026
Merged

Backport: add caching provider option to GatewayProviderOptions#16483
gr2m merged 2 commits into
release-v6.0from
backport-gateway-caching-v6

Conversation

@n1ckoates

@n1ckoates n1ckoates commented Jun 29, 2026

Copy link
Copy Markdown
Member

Background

The caching provider option for the AI Gateway was previously untyped despite being in AI Gateway docs.

#15768 added it, but only to v7

Summary

Backported that change by updating the gatewayProviderOptions zod schema in v6.

Manual Verification

This is properly typed in v6 now with intellisense working and no errors:

  const result = streamText({
    model: 'anthropic/claude-sonnet-4.6',
    system:
      'You are a helpful assistant with access to a large knowledge base...',
    prompt: 'What is the capital of France?',
    providerOptions: {
        gateway: {
            caching: 'auto',
        } satisfies GatewayProviderOptions,
    },
  });

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Fixed #14595

Closes #14609
Closes #14632
Closes #14664
Closes #14886
Closes #15298
Closes #15329
Closes #15458
Closes #15500
Closes #15857

@n1ckoates
n1ckoates marked this pull request as ready for review June 29, 2026 18:36
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 6.0.216 github npm
@ai-sdk/angular 2.0.217 github npm
@ai-sdk/gateway 3.0.140 github npm
@ai-sdk/langchain 2.0.224 github npm
@ai-sdk/llamaindex 2.0.216 github npm
@ai-sdk/moonshotai 2.0.30 github npm
@ai-sdk/react 3.0.218 github npm
@ai-sdk/rsc 2.0.216 github npm
@ai-sdk/svelte 4.0.216 github npm
@ai-sdk/vue 3.0.216 github npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants