Protected_Protected_Protected ReadonlylanguageProtected ReadonlymodelProtectedcalculateProtectedcreateProtectedderiveAdaptive thinking (effort) is preferred when available; older 4.x models only support the legacy extended thinking (budget) API.
ProtectedderiveServer-side compaction (compact_20260112) is available on Claude Opus and Sonnet 4.6 and later.
Heuristic over the model id; override to read the capability from the /v1/models endpoint or for custom endpoints.
ProtectedderiveProtectedfetchProtectedresolvemaxTokens falls back to DEFAULT_MAX_TOKENS since the Messages API requires it.
Protectedretrieve
Cached
/v1/modelslookups keyed by${baseURL}::${model}. Successful lookups are kept for the process lifetime; failed lookups are evicted so the next call retries.