Skip to main content

ModelPricing

@forge/monorepo


@forge/monorepo / backend/src / ModelPricing

Type Alias: ModelPricing

ModelPricing = object

Defined in: backend/src/models/index.ts:76

Prices are per million tokens, in minor currency units, to avoid float drift.

Properties

cacheReadPerMillion?

readonly optional cacheReadPerMillion?: number

Defined in: backend/src/models/index.ts:80


cacheWritePerMillion?

readonly optional cacheWritePerMillion?: number

Defined in: backend/src/models/index.ts:81


currency

readonly currency: string

Defined in: backend/src/models/index.ts:77


inputPerMillion

readonly inputPerMillion: number

Defined in: backend/src/models/index.ts:78


nonTextInput?

readonly optional nonTextInput?: "in-input-tokens" | "per-unit"

Defined in: backend/src/models/index.ts:96

How this provider charges for non-text input — REQ-036 (#185), AC-4.

The field exists because getting it wrong is a wrong bill in either direction, and the two conventions are indistinguishable from the token counts alone:

  • "in-input-tokens" (the default, and what OpenAI does): an image is converted to input tokens by the provider and already counted in inputTokens. Adding a per-image charge on top double-bills.
  • "per-unit": images and audio are billed separately, per image or per second, in addition to the text tokens. Not adding the charge under-bills, silently, and the shortfall scales with usage.

Defaulting to "in-input-tokens" is the safe direction for the model catalogue we ship, and it means every existing pricing record keeps costing exactly what it did.


outputPerMillion

readonly outputPerMillion: number

Defined in: backend/src/models/index.ts:79


perAudioSecondMinorUnits?

readonly optional perAudioSecondMinorUnits?: number

Defined in: backend/src/models/index.ts:100

Minor units per second of audio input. Only consulted when nonTextInput is "per-unit".


perImageMinorUnits?

readonly optional perImageMinorUnits?: number

Defined in: backend/src/models/index.ts:98

Minor units per image sent. Only consulted when nonTextInput is "per-unit".