fix: ensure anthropic models on OR also have variant support (#13498)

This commit is contained in:
Aiden Cline
2026-02-14 14:30:07 -06:00
committed by GitHub
parent 67c985ce82
commit 839c5cda12
4 changed files with 135 additions and 2 deletions

View File

@@ -361,7 +361,7 @@ export namespace ProviderTransform {
switch (model.api.npm) {
case "@openrouter/ai-sdk-provider":
if (!model.id.includes("gpt") && !model.id.includes("gemini-3")) return {}
if (!model.id.includes("gpt") && !model.id.includes("gemini-3") && !model.id.includes("claude")) return {}
return Object.fromEntries(OPENAI_EFFORTS.map((effort) => [effort, { reasoning: { effort } }]))
case "@ai-sdk/gateway":
@@ -763,6 +763,9 @@ export namespace ProviderTransform {
result["promptCacheKey"] = input.sessionID
}
if (input.model.providerID === "openrouter") {
result["prompt_cache_key"] = input.sessionID
}
if (input.model.api.npm === "@ai-sdk/gateway") {
result["gateway"] = {
caching: "auto",