fix(ai): enable xhigh for anthropic opus 4.6

This commit is contained in:
Mario Zechner 2026-02-05 22:57:43 +01:00
parent 9494fa8d3f
commit ee53b53689
4 changed files with 43 additions and 2 deletions

View file

@ -47,10 +47,21 @@ export function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage
/**
* Check if a model supports xhigh thinking level.
* Currently only certain OpenAI Codex models support this.
*
* Supported today:
* - GPT-5.2 / GPT-5.3 model families
* - Anthropic Messages API Opus 4.6 models (xhigh maps to adaptive effort "max")
*/
export function supportsXhigh<TApi extends Api>(model: Model<TApi>): boolean {
return model.id.includes("gpt-5.2") || model.id.includes("gpt-5.3");
if (model.id.includes("gpt-5.2") || model.id.includes("gpt-5.3")) {
return true;
}
if (model.api === "anthropic-messages") {
return model.id.includes("opus-4-6") || model.id.includes("opus-4.6");
}
return false;
}
/**