From 5137f0ec57a0d8464544b4a74d816433e2b6caa2 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Fri, 5 Jun 2026 08:29:06 +0200 Subject: [PATCH] Add model token pricing types Add token-level billing types to Node SDK types: add tokenPrices to ModelBilling and new interfaces ModelBillingTokenPrices and ModelBillingTokenPricesLongContext. Include fields for input/output/cache prices, batchSize, contextMax, and longContext tier. Provides structured metadata for model pricing and long-context tiers used by billing and UI logic. --- nodejs/src/index.ts | 2 ++ nodejs/src/types.ts | 50 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/nodejs/src/index.ts b/nodejs/src/index.ts index c044f2b94..df2a3cf64 100644 --- a/nodejs/src/index.ts +++ b/nodejs/src/index.ts @@ -81,6 +81,8 @@ export type { DefaultAgentConfig, MessageOptions, ModelBilling, + ModelBillingTokenPrices, + ModelBillingTokenPricesLongContext, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, diff --git a/nodejs/src/types.ts b/nodejs/src/types.ts index 75aa5159f..b78485ce6 100644 --- a/nodejs/src/types.ts +++ b/nodejs/src/types.ts @@ -2377,6 +2377,56 @@ export interface ModelPolicy { */ export interface ModelBilling { multiplier?: number; + tokenPrices?: ModelBillingTokenPrices; +} + +/** + * Token-level pricing information for this model + */ +export interface ModelBillingTokenPrices { + /** + * AI Credits cost per billing batch of input tokens + */ + inputPrice?: number; + /** + * AI Credits cost per billing batch of output tokens + */ + outputPrice?: number; + /** + * AI Credits cost per billing batch of cached tokens + */ + cachePrice?: number; + /** + * Number of tokens per standard billing batch + */ + batchSize?: number; + /** + * Prompt token budget (max_prompt_tokens) for the default tier. The total context window is this value plus the model's max_output_tokens. + */ + contextMax?: number; + longContext?: ModelBillingTokenPricesLongContext; +} + +/** + * Long context tier pricing (available for models with extended context windows) + */ +export interface ModelBillingTokenPricesLongContext { + /** + * AI Credits cost per billing batch of input tokens + */ + inputPrice?: number; + /** + * AI Credits cost per billing batch of output tokens + */ + outputPrice?: number; + /** + * AI Credits cost per billing batch of cached tokens + */ + cachePrice?: number; + /** + * Prompt token budget (max_prompt_tokens) for the long context tier. The total context window is this value plus the model's max_output_tokens. + */ + contextMax?: number; } /**