Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ interface ApiModel {
display_name?: string;
}

/** Detect if this is an Anthropic-style API based on the URL */
/** Detect if this is an Anthropic-style API based on the URL hostname. */
function isAnthropicApi(baseUrl: string): boolean {
return baseUrl.includes("anthropic.com");
try {
const host = new URL(baseUrl).hostname.toLowerCase();
return host === "anthropic.com" || host.endsWith(".anthropic.com");
} catch {
return false;
}
}

/**
Expand Down
17 changes: 15 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"ai": "^6.0.158",
"clsx": "^2.1.1",
"lucide-react": "^0.468.0",
"next": "^15.5.18",
"next": "^15.5.21",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-markdown": "^9.0.3",
Expand All @@ -46,10 +46,23 @@
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.5",
"jsdom": "^29.0.2",
"postcss": "^8.5.10",
"postcss": "^8.5.23",
"prettier": "^3.8.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.0",
"vitest": "^4.1.3"
},
"pnpm": {
"overrides": {
"nanoid@>=3 <4": "3.3.18",
"js-yaml@>=4": "4.3.1",
"postcss": "8.5.23",
"undici@>=7": "7.29.0",
"sharp": "0.35.4",
"vite@>=8 <8.0.16": "8.0.16",
"brace-expansion@>=1 <2": "1.1.16",
"brace-expansion@>=3 <5.0.7": "5.0.7",
"@babel/core": "7.29.6"
}
}
}
Loading
Loading