Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gateway-caching-provider-option.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ai-sdk/gateway": patch
---

feat(gateway): add `caching` provider option to `GatewayProviderOptions`
9 changes: 9 additions & 0 deletions packages/gateway/src/gateway-provider-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ const gatewayProviderOptions = lazySchema(() =>
* default.
*/
serviceTier: z.enum(['flex', 'priority']).optional(),
/**
* Enables automatic prompt caching across providers. When set to
* `'auto'`, the gateway applies the appropriate caching strategy for
* the routed provider: it adds a `cache_control` breakpoint to static
* content for providers that require explicit markers (such as
* Anthropic), while providers with implicit caching cache
* automatically. Leave unset to pass requests through unmodified.
*/
caching: z.literal('auto').optional(),
}),
),
);
Expand Down