Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nodejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ export type {
DefaultAgentConfig,
MessageOptions,
ModelBilling,
ModelBillingTokenPrices,
ModelBillingTokenPricesLongContext,
ModelCapabilities,
ModelCapabilitiesOverride,
ModelInfo,
Expand Down
50 changes: 50 additions & 0 deletions nodejs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,56 @@ export interface ModelPolicy {
*/
export interface ModelBilling {
multiplier?: number;
tokenPrices?: ModelBillingTokenPrices;
}
Comment on lines 2378 to +2381
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export interface ModelBilling {
multiplier?: number;

/**

  • Specifies the direct pricing details per token.
  • @remarks
    • Unit: Prices are calculated on a per-token basis (not per-batch).
    • Precedence: If both tokenPrices and multiplier are present in the response, consumers should prefer and default to tokenPrices for accurate billing calculations.
      */
      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;
Comment on lines +2383 to +2402
/**
* 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;
}
Comment on lines +2386 to +2408

/**
* 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;
}
Comment on lines +2413 to 2430

/**
Expand Down
Loading