Skip to main content
@ai-billing/groq
@ai-billing/groq / GroqV3MiddlewareOptions

Interface: GroqV3MiddlewareOptions<TTags>

Defined in: groq/src/ai-sdk/language-model-middleware/v3/language-model-v3-groq-billing-middleware.ts:43 Configuration for createGroqV3Middleware. Extends BaseBillingMiddlewareOptions (destinations, defaultTags, waitUntil, onError) and requires a PriceResolver. Usage is taken from the Groq response; cost is computed from that usage and the resolved ModelPricing using the same rules as the package’s cost helper.

Extends

  • BaseBillingMiddlewareOptions<TTags>

Type Parameters

TTags

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

Properties

destinations?

optional destinations?: Destination<TTags>[]
Defined in: core/dist/index.d.ts:30 One or more billing destinations that receive each emitted BillingEvent.

Inherited from

BaseBillingMiddlewareOptions.destinations

defaultTags?

optional defaultTags?: TTags
Defined in: core/dist/index.d.ts:32 Tags merged into every emitted event.

Inherited from

BaseBillingMiddlewareOptions.defaultTags

waitUntil?

optional waitUntil?: (promise) => void
Defined in: core/dist/index.d.ts:37 Edge-runtime hook (e.g. ctx.waitUntil) used to keep the process alive while billing events are flushed asynchronously.

Parameters

promise
Promise<unknown>

Returns

void

Inherited from

BaseBillingMiddlewareOptions.waitUntil

onError?

optional onError?: (error) => void
Defined in: core/dist/index.d.ts:39 Called when an error occurs during event extraction or dispatch. Defaults to a silent no-op.

Parameters

error
unknown

Returns

void

Inherited from

BaseBillingMiddlewareOptions.onError

priceResolver

priceResolver: PriceResolver
Defined in: groq/src/ai-sdk/language-model-middleware/v3/language-model-v3-groq-billing-middleware.ts:46