fix(google): recognize Google Files URLs when using a baseUrl (#19868)
## Background AI SDK uses a model's `supportedUrls` to decide whether a file URL can be passed directly to the provider or must be downloaded first. The Google provider constructed its `supportedUrls` Google Files URL from the configured `baseURL`. When `baseURL` points to a Google-compatible proxy, Google Files URLs such as: `https://generativelanguage.googleapis.com/v1beta/files/...` do not match the proxy URL. Core therefore treats the file as unsupported and attempts to download it. Google Files URIs are provider resource references intended to be passed to Gemini as `fileData.fileUri`, not public content URLs that can be downloaded. The generic downloader does not authenticate as the Google provider, so the request fails. ## Summary Always include the default Google Files URL pattern in `supportedUrls`. ## End-to-End Verification Verified against the live Gemini API using a local forwarding proxy: 1. Uploaded an MP3 directly through Google's Files API, which returned a canonical `https://generativelanguage.googleapis.com/v1beta/files/...` URI. 2. Created a separate Google provider with its `baseURL` pointing to the local proxy. 3. Passed the canonical Google Files URI as an `audio/mpeg` file part 4. Confirmed that the proxy received only the `generateContent` request and no file download request. 5. The proxy forwarded the request to Google, and Gemini successfully processed the uploaded audio ## Checklist - [x] All commits are signed (PRs with unsigned commits cannot be merged) - [x] Tests have been added / updated (for bug fixes / features) - [] Documentation has been added / updated - [x] A *patch* changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues Fixes https://github.com/vercel/ai/issues/7796 Closes https://github.com/vercel/ai/pull/8776
N
Nick Oates committed
949ef93d90d79608540b0eab32d9d639f76e030b
Parent: 805bbfc
Committed by GitHub <noreply@github.com>
on 8/27/2026, 9:06:09 PM