Skip to main content

IMAGE_TOKEN_ESTIMATE

Constant IMAGE_TOKEN_ESTIMATE 

pub const IMAGE_TOKEN_ESTIMATE: usize = 1_600;
Expand description

Fixed per-image charge in the history estimate, applied to the images preparation dispatches: the markers it lifts from user messages and the attachments a tool-result carrier declares. Approximates the standard-tier Anthropic maximum (1,568 tokens for an image at the 1568px downscale). High-resolution tiers and some models bill more (Anthropic high-res up to 4,784; GPT-4o-mini base 2,833; Qwen-VL ~4k per A4 page): this is a heuristic for trimming, not a ceiling, and provider-reported usage corrects it after the first successful response.