PreModelSwitchHookInput
Fires before a requested model switch takes effect. context_tokens and the fields after it estimate what re-sending the conversation to the new model costs. For the full field descriptions and blocking semantics, see PreModelSwitch.
typescript
type PreModelSwitchHookInput = BaseHookInput & {
hook_event_name: "PreModelSwitch";
from_model: string;
to_model: string;
requested_model: string | null;
source: "command" | "picker" | "sdk";
context_tokens: number;
prompt_cache_warm: boolean;
cache_ttl: "5m" | "1h";
estimated_cache_write_usd: number;
pricing: "configured" | "catalog" | "default";
};