Skip to main content
@ai-billing/gmicloud
@ai-billing/gmicloud / createGmicloudV3Middleware

Function: createGmicloudV3Middleware()

createGmicloudV3Middleware<TTags>(options): LanguageModelV3Middleware
Defined in: gmicloud/src/ai-sdk/language-model-middleware/v3/language-model-v3-gmicloud-billing-middleware.ts:91 Creates a V3 billing middleware for the GMI Cloud provider (@ai-sdk/gmicloud). Deducts cache-read tokens from prompt tokens before billing — GMI Cloud charges only non-cached input at the prompt rate, and cached tokens separately at the cache-read rate.

Type Parameters

TTags

TTags extends JSONObject The shape of the tags object, extending DefaultTags.

Parameters

options

GmicloudV3MiddlewareOptions<TTags> Billing options; see GmicloudV3MiddlewareOptions. A priceResolver is required.

Returns

LanguageModelV3Middleware A V3 billing middleware instance for GMI Cloud.

Example