Skip to content

feat: report image generation usage info in Gateway#12334

Merged
R-Taneja merged 5 commits intomainfrom
report-image-gen-usage-info
Feb 7, 2026
Merged

feat: report image generation usage info in Gateway#12334
R-Taneja merged 5 commits intomainfrom
report-image-gen-usage-info

Conversation

@R-Taneja
Copy link
Copy Markdown
Contributor

@R-Taneja R-Taneja commented Feb 7, 2026

Background

  • GatewayImageModel.doGenerate didn't parse or return the usage field from the gateway server response

Summary

  • Add usage to the response schema and return it from doGenerate, converting nullish values to undefined to match ImageModelV3Usage

Manual Verification

Built the new package and ran a query locally with local gateway dev server, got usage info

Checklist

  • 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)

@R-Taneja R-Taneja enabled auto-merge (squash) February 7, 2026 05:22
@R-Taneja R-Taneja merged commit 70028ab into main Feb 7, 2026
18 checks passed
@R-Taneja R-Taneja deleted the report-image-gen-usage-info branch February 7, 2026 05:25
@R-Taneja R-Taneja added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Feb 7, 2026
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Feb 7, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Feb 7, 2026

✅ Backport PR created: #12338

vercel-ai-sdk bot added a commit that referenced this pull request Feb 7, 2026
This is an automated backport of #12334 to the release-v5.0 branch. FYI
@R-Taneja

---------

Co-authored-by: Rohan Taneja <47066511+R-Taneja@users.noreply.github.com>
@gr2m gr2m added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/gateway Issues related to the @ai-sdk/gateway provider and removed ai/gateway labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/gateway Issues related to the @ai-sdk/gateway provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants