@ai-billing/google / createGoogleV3Middleware
Function: createGoogleV3Middleware()
createGoogleV3Middleware<Defined in: google/src/ai-sdk/language-model-middleware/v3/language-model-v3-google-billing-middleware.ts:97 Creates a V3 billing middleware for the Google provider (TTags>(options):LanguageModelV3Middleware
@ai-sdk/google).
Maps AI SDK usage into billing fields and resolves cost from pricing plus usage.
Type Parameters
TTags
TTags extends JSONObject
The shape of the tags object, extending DefaultTags.
Parameters
options
GoogleV3MiddlewareOptions<TTags>
Billing options; see GoogleV3MiddlewareOptions.
Returns
LanguageModelV3Middleware
A V3 billing middleware instance for Google.
Example
Same wiring asexamples/dev-sandbox/app/api/google (createGoogleV3Middleware is this function’s export
alias from @ai-billing/google).