Skip to content

GatewayProviderOptions type missing 'caching' property (docs mismatch) #14595

@rossanodr

Description

@rossanodr

Description

The documentation for automatic caching in the AI Gateway suggests using the following configuration:

providerOptions: {
  gateway: {
    caching: 'auto',
  },
}

However, when using TypeScript with:

gateway: {
  caching: 'auto',
} satisfies GatewayProviderOptions

it results in the following type error:

Object literal may only specify known properties, and 'caching' does not exist in type '{ only?: string[] | undefined; order?: string[] | undefined; sort?: "tps" | "cost" | "ttft" | undefined; user?: string | undefined; tags?: string[] | undefined; models?: string[] | undefined; ... }'.ts(2353)

It appears that the GatewayProviderOptions type does not include the caching property, even though it is documented as a valid option.

Steps to Reproduce

Follow the documentation: https://vercel.com/docs/ai-gateway/models-and-providers/automatic-caching
Add caching: 'auto' inside gateway options
Use satisfies GatewayProviderOptions (or strict typing)
Observe the TypeScript error

Expected Behavior
The caching property should be included in the GatewayProviderOptions type, or the documentation should reflect the correct usage.

Actual Behavior
TypeScript raises an error because caching is not part of the type definition.

This looks like a mismatch between the documentation and the current type definitions. It’s unclear whether:

caching is deprecated,
not yet released in types,
or should be configured differently.

Clarification would be appreciated.

AI SDK Version

"@ai-sdk/gateway": "^3.0.104",

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedprovider/gatewayIssues related to the @ai-sdk/gateway providerreproduction providedsupport

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions