Surcharge policy for opaque (non-text) content blocks (v3.7).
number — every opaque block reserves this many input tokens.
{ default?, byType? } — per-block.type surcharges with an
optional fallback for types not listed; unlisted types with no
default contribute 0.
All values must be non-negative integers. A block is "opaque" unless
it is a well-formed text block (type: "text" with a string text)
— malformed text blocks are treated as opaque, which errs toward
over-reservation. Applies to blocks in messages[].content and
system arrays.
Type Declaration
number
{byType?:Record<string,number>;default?:number}
OptionalbyType?: Record<string,number>
Per-block-type surcharges, keyed by block.type.
Optionaldefault?: number
Fallback surcharge for opaque types without a byType entry.
Surcharge policy for opaque (non-text) content blocks (v3.7).
number— every opaque block reserves this many input tokens.{ default?, byType? }— per-block.typesurcharges with an optional fallback for types not listed; unlisted types with nodefaultcontribute 0.All values must be non-negative integers. A block is "opaque" unless it is a well-formed text block (
type: "text"with a stringtext) — malformed text blocks are treated as opaque, which errs toward over-reservation. Applies to blocks inmessages[].contentandsystemarrays.