Interface RateSnapshot

A rate version: immutable once published, and kept by a call for its whole life. A component key names a billable quantity (media_second, input_token, output_token, reasoning_token, cached_input_token, tts_character and so on); the host chooses the keys, and every quantity it meters must have one.

interface RateSnapshot {
    version: string;
    currency: "USD";
    components: Readonly<Record<string, RateComponent>>;
    reasoningInOutput: boolean;
    attemptMinimum?: {
        customerMicro: number;
        supplierMicro: number;
    };
}

Properties

version: string

The version's id, unique and never reused.

currency: "USD"

The currency every amount is in.

components: Readonly<Record<string, RateComponent>>

The billable components, by key.

reasoningInOutput: boolean

Whether the provider's output count already includes its reasoning tokens. When true, a reasoning_token quantity is reported for visibility and not billed again, so reasoning is counted once.

attemptMinimum?: {
    customerMicro: number;
    supplierMicro: number;
}

A charge every attempt incurs whatever its usage (a provider's minimum charge), in micro-dollars per side.

Type declaration

  • Readonly customerMicro: number
  • Readonly supplierMicro: number