Skip to content

Commit 46acd1c

Browse files
author
octo-patch
committed
fix: accept Claude session keys in sk-ant-sid02 format (fixes #935)
Anthropic now issues session keys with the prefix sk-ant-sid02- in addition to the previous sk-ant-sid01- format. The validation was too strict, rejecting valid new-format keys with an error. Relaxed the check to match any sk-ant-sid prefix to be forward-compatible with future key format versions.
1 parent c236a4b commit 46acd1c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/services/clients/claude/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export class Claude {
7474
if (!sessionKey) {
7575
throw new Error('Session key required')
7676
}
77-
if (!sessionKey.startsWith('sk-ant-sid01')) {
78-
throw new Error('Session key invalid: Must be in the format sk-ant-sid01-*****')
77+
if (!sessionKey.startsWith('sk-ant-sid')) {
78+
throw new Error('Session key invalid: Must be in the format sk-ant-sid01-***** or sk-ant-sid02-*****')
7979
}
8080
if (fetch) {
8181
this.fetch = fetch

0 commit comments

Comments
 (0)