@@ -20,6 +20,7 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>
2020 const isBedrockModelArn = providerModel . startsWith ( "arn:aws:bedrock:" )
2121 const isBedrockModelID = providerModel . startsWith ( "global.anthropic." )
2222 const isBedrock = isBedrockModelArn || isBedrockModelID
23+ const isDatabricks = providerModel . startsWith ( "databricks-claude-" )
2324 const supports1m = reqModel . includes ( "sonnet" ) || reqModel . includes ( "opus-4-6" )
2425 return {
2526 format : "anthropic" ,
@@ -28,7 +29,7 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>
2829 ? `${ providerApi } /model/${ isBedrockModelArn ? encodeURIComponent ( providerModel ) : providerModel } /${ isStream ? "invoke-with-response-stream" : "invoke" } `
2930 : providerApi + "/messages" ,
3031 modifyHeaders : ( headers : Headers , body : Record < string , any > , apiKey : string ) => {
31- if ( isBedrock ) {
32+ if ( isBedrock || isDatabricks ) {
3233 headers . set ( "Authorization" , `Bearer ${ apiKey } ` )
3334 } else {
3435 headers . set ( "x-api-key" , apiKey )
@@ -47,9 +48,14 @@ export const anthropicHelper: ProviderHelper = ({ reqModel, providerModel }) =>
4748 model : undefined ,
4849 stream : undefined ,
4950 }
50- : {
51- service_tier : "standard_only" ,
52- } ) ,
51+ : isDatabricks
52+ ? {
53+ anthropic_version : "bedrock-2023-05-31" ,
54+ anthropic_beta : supports1m ? [ "context-1m-2025-08-07" ] : undefined ,
55+ }
56+ : {
57+ service_tier : "standard_only" ,
58+ } ) ,
5359 } ) ,
5460 createBinaryStreamDecoder : ( ) => {
5561 if ( ! isBedrock ) return undefined
0 commit comments