@hebo-ai/gateway 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Learn more in our blog post: [Yet Another AI Gateway?](https://hebo.ai/blog/2601
19
19
  - 🗂️ Model catalog with extensible metadata capabilities.
20
20
  - 🪝 Hook system to customize routing, auth, rate limits, and shape responses.
21
21
  - 🧰 Low-level OpenAI-compatible schema, converters, and middleware helpers.
22
- - 👁️ OpenTelemetry support for GenAI semantic conventions (Langfuse-compatible).
22
+ - 👁️ Observability via OTel GenAI semantic conventions (Langfuse-compatible).
23
23
 
24
24
  ## 📦 Installation
25
25
 
@@ -272,7 +272,7 @@ const gw = gateway({
272
272
 
273
273
  ### Hooks
274
274
 
275
- Hooks allow you to plug-into the lifecycle of the gateway and enrich it with additional functionality, like your actual routing logic. All hooks are available as async and non-async.
275
+ Hooks allow you to plug into the lifecycle of the gateway and enrich it with additional functionality, like your actual routing logic. All hooks are available as async and non-async.
276
276
 
277
277
  ```ts
278
278
  const gw = gateway({
@@ -315,10 +315,10 @@ const gw = gateway({
315
315
  * @param ctx.modelId Incoming model ID.
316
316
  * @returns Canonical model ID or undefined to keep original.
317
317
  */
318
- resolveModelId?: (ctx: {
318
+ resolveModelId: async (ctx: {
319
319
  body: ChatCompletionsBody | EmbeddingsBody;
320
320
  modelId: ModelId;
321
- }) => ModelId | void | Promise<ModelId | void> {
321
+ }): Promise<ModelId | void> => {
322
322
  // Example Use Cases:
323
323
  // - Resolve modelAlias to modelId
324
324
  return undefined;
@@ -328,7 +328,7 @@ const gw = gateway({
328
328
  * @param ctx.providers ProviderRegistry from config.
329
329
  * @param ctx.models ModelCatalog from config.
330
330
  * @param ctx.body The parsed body object with all call parameters.
331
- * @param ctx.modelId Resolved model ID.
331
+ * @param ctx.resolvedModelId Resolved model ID.
332
332
  * @param ctx.operation Operation type ("chat" | "embeddings").
333
333
  * @returns ProviderV3 to override, or undefined to use default.
334
334
  */
@@ -336,7 +336,7 @@ const gw = gateway({
336
336
  providers: ProviderRegistry;
337
337
  models: ModelCatalog;
338
338
  body: ChatCompletionsBody | EmbeddingsBody;
339
- modelId: ModelId;
339
+ resolvedModelId: ModelId;
340
340
  operation: "chat" | "embeddings";
341
341
  }): Promise<ProviderV3 | void> => {
342
342
  // Example Use Cases:
@@ -350,8 +350,8 @@ const gw = gateway({
350
350
  * @returns Modified result, or undefined to keep original.
351
351
  */
352
352
  after: async (ctx: {
353
- result: ChatCompletions | ReadableStream<ChatCompletionsChunk | OpenAIError> | Embeddings
354
- }): Promise<ChatCompletions | ReadableStream<ChatCompletionsChunk | OpenAIError> | Embeddings | void> => {
353
+ result: ChatCompletions | ReadableStream<ChatCompletionsChunk | Error> | Embeddings;
354
+ }): Promise<ChatCompletions | ReadableStream<ChatCompletionsChunk | Error> | Embeddings | void> => {
355
355
  // Example Use Cases:
356
356
  // - Transform result
357
357
  // - Result logging
@@ -310,6 +310,84 @@ export declare const claudeSonnet45: <const O extends {
310
310
  context: number;
311
311
  providers: readonly ["anthropic", "bedrock", "vertex"];
312
312
  } & O>;
313
+ export declare const claudeSonnet46: <const O extends {
314
+ name?: string | undefined;
315
+ created?: string | undefined;
316
+ knowledge?: string | undefined;
317
+ modalities?: {
318
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
319
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
320
+ } | undefined;
321
+ context?: number | undefined;
322
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
323
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
324
+ readonly [x: number]: string | undefined;
325
+ toString?: (() => string) | undefined;
326
+ charAt?: {} | undefined;
327
+ charCodeAt?: {} | undefined;
328
+ concat?: {} | undefined;
329
+ indexOf?: {} | undefined;
330
+ lastIndexOf?: {} | undefined;
331
+ localeCompare?: {} | undefined;
332
+ match?: {} | undefined;
333
+ replace?: {} | undefined;
334
+ search?: {} | undefined;
335
+ slice?: {} | undefined;
336
+ split?: {} | undefined;
337
+ substring?: {} | undefined;
338
+ toLowerCase?: (() => string) | undefined;
339
+ toLocaleLowerCase?: {} | undefined;
340
+ toUpperCase?: (() => string) | undefined;
341
+ toLocaleUpperCase?: {} | undefined;
342
+ trim?: (() => string) | undefined;
343
+ readonly length?: number | undefined;
344
+ substr?: {} | undefined;
345
+ valueOf?: (() => string) | undefined;
346
+ codePointAt?: {} | undefined;
347
+ includes?: {} | undefined;
348
+ endsWith?: {} | undefined;
349
+ normalize?: {} | undefined;
350
+ repeat?: {} | undefined;
351
+ startsWith?: {} | undefined;
352
+ anchor?: {} | undefined;
353
+ big?: (() => string) | undefined;
354
+ blink?: (() => string) | undefined;
355
+ bold?: (() => string) | undefined;
356
+ fixed?: (() => string) | undefined;
357
+ fontcolor?: {} | undefined;
358
+ fontsize?: {} | undefined;
359
+ italics?: (() => string) | undefined;
360
+ link?: {} | undefined;
361
+ small?: (() => string) | undefined;
362
+ strike?: (() => string) | undefined;
363
+ sub?: (() => string) | undefined;
364
+ sup?: (() => string) | undefined;
365
+ padStart?: {} | undefined;
366
+ padEnd?: {} | undefined;
367
+ trimEnd?: (() => string) | undefined;
368
+ trimStart?: (() => string) | undefined;
369
+ trimLeft?: (() => string) | undefined;
370
+ trimRight?: (() => string) | undefined;
371
+ matchAll?: {} | undefined;
372
+ replaceAll?: {} | undefined;
373
+ at?: {} | undefined;
374
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
375
+ })[] | undefined;
376
+ additionalProperties?: {
377
+ [x: string]: unknown;
378
+ } | undefined;
379
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
380
+ name: string;
381
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
382
+ created: string;
383
+ knowledge: string;
384
+ modalities: {
385
+ input: readonly ["text", "image", "pdf", "file"];
386
+ output: readonly ["text"];
387
+ };
388
+ context: number;
389
+ providers: readonly ["anthropic", "bedrock", "vertex"];
390
+ } & O>;
313
391
  export declare const claudeSonnet4: <const O extends {
314
392
  name?: string | undefined;
315
393
  created?: string | undefined;
@@ -923,6 +1001,83 @@ export declare const claude: {
923
1001
  additionalProperties?: {
924
1002
  [x: string]: unknown;
925
1003
  } | undefined;
1004
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
1005
+ name: string;
1006
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
1007
+ created: string;
1008
+ knowledge: string;
1009
+ modalities: {
1010
+ input: readonly ["text", "image", "pdf", "file"];
1011
+ output: readonly ["text"];
1012
+ };
1013
+ context: number;
1014
+ providers: readonly ["anthropic", "bedrock", "vertex"];
1015
+ } & O>, <const O extends {
1016
+ name?: string | undefined;
1017
+ created?: string | undefined;
1018
+ knowledge?: string | undefined;
1019
+ modalities?: {
1020
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
1021
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
1022
+ } | undefined;
1023
+ context?: number | undefined;
1024
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
1025
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
1026
+ readonly [x: number]: string | undefined;
1027
+ toString?: (() => string) | undefined;
1028
+ charAt?: {} | undefined;
1029
+ charCodeAt?: {} | undefined;
1030
+ concat?: {} | undefined;
1031
+ indexOf?: {} | undefined;
1032
+ lastIndexOf?: {} | undefined;
1033
+ localeCompare?: {} | undefined;
1034
+ match?: {} | undefined;
1035
+ replace?: {} | undefined;
1036
+ search?: {} | undefined;
1037
+ slice?: {} | undefined;
1038
+ split?: {} | undefined;
1039
+ substring?: {} | undefined;
1040
+ toLowerCase?: (() => string) | undefined;
1041
+ toLocaleLowerCase?: {} | undefined;
1042
+ toUpperCase?: (() => string) | undefined;
1043
+ toLocaleUpperCase?: {} | undefined;
1044
+ trim?: (() => string) | undefined;
1045
+ readonly length?: number | undefined;
1046
+ substr?: {} | undefined;
1047
+ valueOf?: (() => string) | undefined;
1048
+ codePointAt?: {} | undefined;
1049
+ includes?: {} | undefined;
1050
+ endsWith?: {} | undefined;
1051
+ normalize?: {} | undefined;
1052
+ repeat?: {} | undefined;
1053
+ startsWith?: {} | undefined;
1054
+ anchor?: {} | undefined;
1055
+ big?: (() => string) | undefined;
1056
+ blink?: (() => string) | undefined;
1057
+ bold?: (() => string) | undefined;
1058
+ fixed?: (() => string) | undefined;
1059
+ fontcolor?: {} | undefined;
1060
+ fontsize?: {} | undefined;
1061
+ italics?: (() => string) | undefined;
1062
+ link?: {} | undefined;
1063
+ small?: (() => string) | undefined;
1064
+ strike?: (() => string) | undefined;
1065
+ sub?: (() => string) | undefined;
1066
+ sup?: (() => string) | undefined;
1067
+ padStart?: {} | undefined;
1068
+ padEnd?: {} | undefined;
1069
+ trimEnd?: (() => string) | undefined;
1070
+ trimStart?: (() => string) | undefined;
1071
+ trimLeft?: (() => string) | undefined;
1072
+ trimRight?: (() => string) | undefined;
1073
+ matchAll?: {} | undefined;
1074
+ replaceAll?: {} | undefined;
1075
+ at?: {} | undefined;
1076
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
1077
+ })[] | undefined;
1078
+ additionalProperties?: {
1079
+ [x: string]: unknown;
1080
+ } | undefined;
926
1081
  }>(override?: O | undefined) => Record<"anthropic/claude-opus-4.6", {
927
1082
  name: string;
928
1083
  capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
@@ -1309,6 +1464,83 @@ export declare const claude: {
1309
1464
  additionalProperties?: {
1310
1465
  [x: string]: unknown;
1311
1466
  } | undefined;
1467
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
1468
+ name: string;
1469
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
1470
+ created: string;
1471
+ knowledge: string;
1472
+ modalities: {
1473
+ input: readonly ["text", "image", "pdf", "file"];
1474
+ output: readonly ["text"];
1475
+ };
1476
+ context: number;
1477
+ providers: readonly ["anthropic", "bedrock", "vertex"];
1478
+ } & O>) | (<const O extends {
1479
+ name?: string | undefined;
1480
+ created?: string | undefined;
1481
+ knowledge?: string | undefined;
1482
+ modalities?: {
1483
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
1484
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
1485
+ } | undefined;
1486
+ context?: number | undefined;
1487
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
1488
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
1489
+ readonly [x: number]: string | undefined;
1490
+ toString?: (() => string) | undefined;
1491
+ charAt?: {} | undefined;
1492
+ charCodeAt?: {} | undefined;
1493
+ concat?: {} | undefined;
1494
+ indexOf?: {} | undefined;
1495
+ lastIndexOf?: {} | undefined;
1496
+ localeCompare?: {} | undefined;
1497
+ match?: {} | undefined;
1498
+ replace?: {} | undefined;
1499
+ search?: {} | undefined;
1500
+ slice?: {} | undefined;
1501
+ split?: {} | undefined;
1502
+ substring?: {} | undefined;
1503
+ toLowerCase?: (() => string) | undefined;
1504
+ toLocaleLowerCase?: {} | undefined;
1505
+ toUpperCase?: (() => string) | undefined;
1506
+ toLocaleUpperCase?: {} | undefined;
1507
+ trim?: (() => string) | undefined;
1508
+ readonly length?: number | undefined;
1509
+ substr?: {} | undefined;
1510
+ valueOf?: (() => string) | undefined;
1511
+ codePointAt?: {} | undefined;
1512
+ includes?: {} | undefined;
1513
+ endsWith?: {} | undefined;
1514
+ normalize?: {} | undefined;
1515
+ repeat?: {} | undefined;
1516
+ startsWith?: {} | undefined;
1517
+ anchor?: {} | undefined;
1518
+ big?: (() => string) | undefined;
1519
+ blink?: (() => string) | undefined;
1520
+ bold?: (() => string) | undefined;
1521
+ fixed?: (() => string) | undefined;
1522
+ fontcolor?: {} | undefined;
1523
+ fontsize?: {} | undefined;
1524
+ italics?: (() => string) | undefined;
1525
+ link?: {} | undefined;
1526
+ small?: (() => string) | undefined;
1527
+ strike?: (() => string) | undefined;
1528
+ sub?: (() => string) | undefined;
1529
+ sup?: (() => string) | undefined;
1530
+ padStart?: {} | undefined;
1531
+ padEnd?: {} | undefined;
1532
+ trimEnd?: (() => string) | undefined;
1533
+ trimStart?: (() => string) | undefined;
1534
+ trimLeft?: (() => string) | undefined;
1535
+ trimRight?: (() => string) | undefined;
1536
+ matchAll?: {} | undefined;
1537
+ replaceAll?: {} | undefined;
1538
+ at?: {} | undefined;
1539
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
1540
+ })[] | undefined;
1541
+ additionalProperties?: {
1542
+ [x: string]: unknown;
1543
+ } | undefined;
1312
1544
  }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4", {
1313
1545
  name: string;
1314
1546
  capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
@@ -1849,6 +2081,83 @@ export declare const claude: {
1849
2081
  additionalProperties?: {
1850
2082
  [x: string]: unknown;
1851
2083
  } | undefined;
2084
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
2085
+ name: string;
2086
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
2087
+ created: string;
2088
+ knowledge: string;
2089
+ modalities: {
2090
+ input: readonly ["text", "image", "pdf", "file"];
2091
+ output: readonly ["text"];
2092
+ };
2093
+ context: number;
2094
+ providers: readonly ["anthropic", "bedrock", "vertex"];
2095
+ } & O>, <const O extends {
2096
+ name?: string | undefined;
2097
+ created?: string | undefined;
2098
+ knowledge?: string | undefined;
2099
+ modalities?: {
2100
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
2101
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
2102
+ } | undefined;
2103
+ context?: number | undefined;
2104
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
2105
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
2106
+ readonly [x: number]: string | undefined;
2107
+ toString?: (() => string) | undefined;
2108
+ charAt?: {} | undefined;
2109
+ charCodeAt?: {} | undefined;
2110
+ concat?: {} | undefined;
2111
+ indexOf?: {} | undefined;
2112
+ lastIndexOf?: {} | undefined;
2113
+ localeCompare?: {} | undefined;
2114
+ match?: {} | undefined;
2115
+ replace?: {} | undefined;
2116
+ search?: {} | undefined;
2117
+ slice?: {} | undefined;
2118
+ split?: {} | undefined;
2119
+ substring?: {} | undefined;
2120
+ toLowerCase?: (() => string) | undefined;
2121
+ toLocaleLowerCase?: {} | undefined;
2122
+ toUpperCase?: (() => string) | undefined;
2123
+ toLocaleUpperCase?: {} | undefined;
2124
+ trim?: (() => string) | undefined;
2125
+ readonly length?: number | undefined;
2126
+ substr?: {} | undefined;
2127
+ valueOf?: (() => string) | undefined;
2128
+ codePointAt?: {} | undefined;
2129
+ includes?: {} | undefined;
2130
+ endsWith?: {} | undefined;
2131
+ normalize?: {} | undefined;
2132
+ repeat?: {} | undefined;
2133
+ startsWith?: {} | undefined;
2134
+ anchor?: {} | undefined;
2135
+ big?: (() => string) | undefined;
2136
+ blink?: (() => string) | undefined;
2137
+ bold?: (() => string) | undefined;
2138
+ fixed?: (() => string) | undefined;
2139
+ fontcolor?: {} | undefined;
2140
+ fontsize?: {} | undefined;
2141
+ italics?: (() => string) | undefined;
2142
+ link?: {} | undefined;
2143
+ small?: (() => string) | undefined;
2144
+ strike?: (() => string) | undefined;
2145
+ sub?: (() => string) | undefined;
2146
+ sup?: (() => string) | undefined;
2147
+ padStart?: {} | undefined;
2148
+ padEnd?: {} | undefined;
2149
+ trimEnd?: (() => string) | undefined;
2150
+ trimStart?: (() => string) | undefined;
2151
+ trimLeft?: (() => string) | undefined;
2152
+ trimRight?: (() => string) | undefined;
2153
+ matchAll?: {} | undefined;
2154
+ replaceAll?: {} | undefined;
2155
+ at?: {} | undefined;
2156
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
2157
+ })[] | undefined;
2158
+ additionalProperties?: {
2159
+ [x: string]: unknown;
2160
+ } | undefined;
1852
2161
  }>(override?: O | undefined) => Record<"anthropic/claude-opus-4.6", {
1853
2162
  name: string;
1854
2163
  capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
@@ -2698,6 +3007,83 @@ export declare const claude: {
2698
3007
  additionalProperties?: {
2699
3008
  [x: string]: unknown;
2700
3009
  } | undefined;
3010
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
3011
+ name: string;
3012
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
3013
+ created: string;
3014
+ knowledge: string;
3015
+ modalities: {
3016
+ input: readonly ["text", "image", "pdf", "file"];
3017
+ output: readonly ["text"];
3018
+ };
3019
+ context: number;
3020
+ providers: readonly ["anthropic", "bedrock", "vertex"];
3021
+ } & O>, <const O extends {
3022
+ name?: string | undefined;
3023
+ created?: string | undefined;
3024
+ knowledge?: string | undefined;
3025
+ modalities?: {
3026
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
3027
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
3028
+ } | undefined;
3029
+ context?: number | undefined;
3030
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
3031
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
3032
+ readonly [x: number]: string | undefined;
3033
+ toString?: (() => string) | undefined;
3034
+ charAt?: {} | undefined;
3035
+ charCodeAt?: {} | undefined;
3036
+ concat?: {} | undefined;
3037
+ indexOf?: {} | undefined;
3038
+ lastIndexOf?: {} | undefined;
3039
+ localeCompare?: {} | undefined;
3040
+ match?: {} | undefined;
3041
+ replace?: {} | undefined;
3042
+ search?: {} | undefined;
3043
+ slice?: {} | undefined;
3044
+ split?: {} | undefined;
3045
+ substring?: {} | undefined;
3046
+ toLowerCase?: (() => string) | undefined;
3047
+ toLocaleLowerCase?: {} | undefined;
3048
+ toUpperCase?: (() => string) | undefined;
3049
+ toLocaleUpperCase?: {} | undefined;
3050
+ trim?: (() => string) | undefined;
3051
+ readonly length?: number | undefined;
3052
+ substr?: {} | undefined;
3053
+ valueOf?: (() => string) | undefined;
3054
+ codePointAt?: {} | undefined;
3055
+ includes?: {} | undefined;
3056
+ endsWith?: {} | undefined;
3057
+ normalize?: {} | undefined;
3058
+ repeat?: {} | undefined;
3059
+ startsWith?: {} | undefined;
3060
+ anchor?: {} | undefined;
3061
+ big?: (() => string) | undefined;
3062
+ blink?: (() => string) | undefined;
3063
+ bold?: (() => string) | undefined;
3064
+ fixed?: (() => string) | undefined;
3065
+ fontcolor?: {} | undefined;
3066
+ fontsize?: {} | undefined;
3067
+ italics?: (() => string) | undefined;
3068
+ link?: {} | undefined;
3069
+ small?: (() => string) | undefined;
3070
+ strike?: (() => string) | undefined;
3071
+ sub?: (() => string) | undefined;
3072
+ sup?: (() => string) | undefined;
3073
+ padStart?: {} | undefined;
3074
+ padEnd?: {} | undefined;
3075
+ trimEnd?: (() => string) | undefined;
3076
+ trimStart?: (() => string) | undefined;
3077
+ trimLeft?: (() => string) | undefined;
3078
+ trimRight?: (() => string) | undefined;
3079
+ matchAll?: {} | undefined;
3080
+ replaceAll?: {} | undefined;
3081
+ at?: {} | undefined;
3082
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
3083
+ })[] | undefined;
3084
+ additionalProperties?: {
3085
+ [x: string]: unknown;
3086
+ } | undefined;
2701
3087
  }>(override?: O | undefined) => Record<"anthropic/claude-opus-4.6", {
2702
3088
  name: string;
2703
3089
  capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
@@ -3784,6 +4170,83 @@ export declare const claude: {
3784
4170
  additionalProperties?: {
3785
4171
  [x: string]: unknown;
3786
4172
  } | undefined;
4173
+ }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.6", {
4174
+ name: string;
4175
+ capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
4176
+ created: string;
4177
+ knowledge: string;
4178
+ modalities: {
4179
+ input: readonly ["text", "image", "pdf", "file"];
4180
+ output: readonly ["text"];
4181
+ };
4182
+ context: number;
4183
+ providers: readonly ["anthropic", "bedrock", "vertex"];
4184
+ } & O>, <const O extends {
4185
+ name?: string | undefined;
4186
+ created?: string | undefined;
4187
+ knowledge?: string | undefined;
4188
+ modalities?: {
4189
+ input?: readonly ("text" | "file" | "image" | "audio" | "video" | "pdf")[] | undefined;
4190
+ output?: readonly ("text" | "embedding" | "image" | "audio" | "video")[] | undefined;
4191
+ } | undefined;
4192
+ context?: number | undefined;
4193
+ capabilities?: readonly ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[] | undefined;
4194
+ providers?: readonly ("anthropic" | "azure" | "bedrock" | "cohere" | "groq" | "openai" | "vertex" | "voyage" | {
4195
+ readonly [x: number]: string | undefined;
4196
+ toString?: (() => string) | undefined;
4197
+ charAt?: {} | undefined;
4198
+ charCodeAt?: {} | undefined;
4199
+ concat?: {} | undefined;
4200
+ indexOf?: {} | undefined;
4201
+ lastIndexOf?: {} | undefined;
4202
+ localeCompare?: {} | undefined;
4203
+ match?: {} | undefined;
4204
+ replace?: {} | undefined;
4205
+ search?: {} | undefined;
4206
+ slice?: {} | undefined;
4207
+ split?: {} | undefined;
4208
+ substring?: {} | undefined;
4209
+ toLowerCase?: (() => string) | undefined;
4210
+ toLocaleLowerCase?: {} | undefined;
4211
+ toUpperCase?: (() => string) | undefined;
4212
+ toLocaleUpperCase?: {} | undefined;
4213
+ trim?: (() => string) | undefined;
4214
+ readonly length?: number | undefined;
4215
+ substr?: {} | undefined;
4216
+ valueOf?: (() => string) | undefined;
4217
+ codePointAt?: {} | undefined;
4218
+ includes?: {} | undefined;
4219
+ endsWith?: {} | undefined;
4220
+ normalize?: {} | undefined;
4221
+ repeat?: {} | undefined;
4222
+ startsWith?: {} | undefined;
4223
+ anchor?: {} | undefined;
4224
+ big?: (() => string) | undefined;
4225
+ blink?: (() => string) | undefined;
4226
+ bold?: (() => string) | undefined;
4227
+ fixed?: (() => string) | undefined;
4228
+ fontcolor?: {} | undefined;
4229
+ fontsize?: {} | undefined;
4230
+ italics?: (() => string) | undefined;
4231
+ link?: {} | undefined;
4232
+ small?: (() => string) | undefined;
4233
+ strike?: (() => string) | undefined;
4234
+ sub?: (() => string) | undefined;
4235
+ sup?: (() => string) | undefined;
4236
+ padStart?: {} | undefined;
4237
+ padEnd?: {} | undefined;
4238
+ trimEnd?: (() => string) | undefined;
4239
+ trimStart?: (() => string) | undefined;
4240
+ trimLeft?: (() => string) | undefined;
4241
+ trimRight?: (() => string) | undefined;
4242
+ matchAll?: {} | undefined;
4243
+ replaceAll?: {} | undefined;
4244
+ at?: {} | undefined;
4245
+ [Symbol.iterator]?: (() => StringIterator<string>) | undefined;
4246
+ })[] | undefined;
4247
+ additionalProperties?: {
4248
+ [x: string]: unknown;
4249
+ } | undefined;
3787
4250
  }>(override?: O | undefined) => Record<"anthropic/claude-sonnet-4.5", {
3788
4251
  name: string;
3789
4252
  capabilities: ("temperature" | "reasoning" | "attachments" | "tool_call" | "structured_output")[];
@@ -43,6 +43,14 @@ export const claudeSonnet45 = presetFor()("anthropic/claude-sonnet-4.5", {
43
43
  created: "2025-09-29",
44
44
  knowledge: "2025-07",
45
45
  });
46
+ export const claudeSonnet46 = presetFor()("anthropic/claude-sonnet-4.6", {
47
+ ...CLAUDE_BASE,
48
+ ...CLAUDE_PDF_MODALITIES,
49
+ name: "Claude Sonnet 4.6",
50
+ capabilities: [...CLAUDE_BASE.capabilities, "reasoning"],
51
+ created: "2026-02-17",
52
+ knowledge: "2025-08",
53
+ });
46
54
  export const claudeSonnet4 = presetFor()("anthropic/claude-sonnet-4", {
47
55
  ...CLAUDE_BASE,
48
56
  ...CLAUDE_PDF_MODALITIES,
@@ -99,7 +107,7 @@ export const claudeOpus4 = presetFor()("anthropic/claude-opus-4", {
99
107
  knowledge: "2025-03",
100
108
  });
101
109
  const claudeAtomic = {
102
- "v4.6": [claudeOpus46],
110
+ "v4.6": [claudeSonnet46, claudeOpus46],
103
111
  "v4.5": [claudeHaiku45, claudeSonnet45, claudeOpus45],
104
112
  "v4.1": [claudeOpus41],
105
113
  v4: [claudeSonnet4, claudeOpus4],
@@ -107,7 +115,7 @@ const claudeAtomic = {
107
115
  "v3.5": [claudeSonnet35, claudeHaiku35],
108
116
  v3: [claudeHaiku3],
109
117
  haiku: [claudeHaiku45, claudeHaiku35, claudeHaiku3],
110
- sonnet: [claudeSonnet45, claudeSonnet4, claudeSonnet37, claudeSonnet35],
118
+ sonnet: [claudeSonnet46, claudeSonnet45, claudeSonnet4, claudeSonnet37, claudeSonnet35],
111
119
  opus: [claudeOpus46, claudeOpus45, claudeOpus41, claudeOpus4],
112
120
  };
113
121
  const claudeGroups = {
@@ -1,5 +1,5 @@
1
1
  import type { ProviderId } from "../providers/types";
2
- export declare const CANONICAL_MODEL_IDS: readonly ["anthropic/claude-opus-4.6", "anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4.5", "anthropic/claude-opus-4.1", "anthropic/claude-opus-4", "anthropic/claude-sonnet-4", "anthropic/claude-sonnet-3.7", "anthropic/claude-sonnet-3.5", "anthropic/claude-haiku-3.5", "anthropic/claude-haiku-3", "openai/gpt-oss-20b", "openai/gpt-oss-120b", "openai/gpt-5", "openai/gpt-5-pro", "openai/gpt-5.2", "openai/gpt-5.2-chat", "openai/gpt-5.2-pro", "openai/gpt-5.2-codex", "openai/gpt-5.3-codex", "openai/gpt-5-mini", "openai/gpt-5-nano", "openai/gpt-5-codex", "openai/gpt-5.1-codex", "openai/gpt-5.1-codex-max", "openai/gpt-5.1-chat", "openai/gpt-5.1", "openai/text-embedding-3-small", "openai/text-embedding-3-large", "amazon/nova-micro", "amazon/nova-lite", "amazon/nova-pro", "amazon/nova-premier", "amazon/nova-2-lite", "amazon/nova-2-multimodal-embeddings", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash", "google/gemini-2.5-pro", "google/gemini-3-flash-preview", "google/gemini-3-pro-preview", "google/embedding-001", "meta/llama-3.1-8b", "meta/llama-3.1-70b", "meta/llama-3.1-405b", "meta/llama-3.2-1b", "meta/llama-3.2-3b", "meta/llama-3.2-11b", "meta/llama-3.2-90b", "meta/llama-3.3-70b", "meta/llama-4-scout", "meta/llama-4-maverick", "cohere/embed-v4.0", "cohere/embed-english-v3.0", "cohere/embed-english-light-v3.0", "cohere/embed-multilingual-v3.0", "cohere/embed-multilingual-light-v3.0", "cohere/command-a", "cohere/command-r7b", "cohere/command-a-translate", "cohere/command-a-reasoning", "cohere/command-a-vision", "cohere/command-r", "cohere/command-r-plus", "voyage/voyage-2-code", "voyage/voyage-2-law", "voyage/voyage-2-finance", "voyage/voyage-3-code", "voyage/voyage-3-large", "voyage/voyage-3.5-lite", "voyage/voyage-3.5", "voyage/voyage-4-lite", "voyage/voyage-4", "voyage/voyage-4-large"];
2
+ export declare const CANONICAL_MODEL_IDS: readonly ["anthropic/claude-opus-4.6", "anthropic/claude-sonnet-4.6", "anthropic/claude-haiku-4.5", "anthropic/claude-sonnet-4.5", "anthropic/claude-opus-4.5", "anthropic/claude-opus-4.1", "anthropic/claude-opus-4", "anthropic/claude-sonnet-4", "anthropic/claude-sonnet-3.7", "anthropic/claude-sonnet-3.5", "anthropic/claude-haiku-3.5", "anthropic/claude-haiku-3", "openai/gpt-oss-20b", "openai/gpt-oss-120b", "openai/gpt-5", "openai/gpt-5-pro", "openai/gpt-5.2", "openai/gpt-5.2-chat", "openai/gpt-5.2-pro", "openai/gpt-5.2-codex", "openai/gpt-5.3-codex", "openai/gpt-5-mini", "openai/gpt-5-nano", "openai/gpt-5-codex", "openai/gpt-5.1-codex", "openai/gpt-5.1-codex-max", "openai/gpt-5.1-chat", "openai/gpt-5.1", "openai/text-embedding-3-small", "openai/text-embedding-3-large", "amazon/nova-micro", "amazon/nova-lite", "amazon/nova-pro", "amazon/nova-premier", "amazon/nova-2-lite", "amazon/nova-2-multimodal-embeddings", "google/gemini-2.5-flash-lite", "google/gemini-2.5-flash", "google/gemini-2.5-pro", "google/gemini-3-flash-preview", "google/gemini-3-pro-preview", "google/embedding-001", "meta/llama-3.1-8b", "meta/llama-3.1-70b", "meta/llama-3.1-405b", "meta/llama-3.2-1b", "meta/llama-3.2-3b", "meta/llama-3.2-11b", "meta/llama-3.2-90b", "meta/llama-3.3-70b", "meta/llama-4-scout", "meta/llama-4-maverick", "cohere/embed-v4.0", "cohere/embed-english-v3.0", "cohere/embed-english-light-v3.0", "cohere/embed-multilingual-v3.0", "cohere/embed-multilingual-light-v3.0", "cohere/command-a", "cohere/command-r7b", "cohere/command-a-translate", "cohere/command-a-reasoning", "cohere/command-a-vision", "cohere/command-r", "cohere/command-r-plus", "voyage/voyage-2-code", "voyage/voyage-2-law", "voyage/voyage-2-finance", "voyage/voyage-3-code", "voyage/voyage-3-large", "voyage/voyage-3.5-lite", "voyage/voyage-3.5", "voyage/voyage-4-lite", "voyage/voyage-4", "voyage/voyage-4-large"];
3
3
  export type CanonicalModelId = (typeof CANONICAL_MODEL_IDS)[number];
4
4
  export type ModelId = CanonicalModelId | (string & {});
5
5
  export type CatalogModel = {
@@ -1,6 +1,7 @@
1
1
  export const CANONICAL_MODEL_IDS = [
2
2
  // Anthropic
3
3
  "anthropic/claude-opus-4.6",
4
+ "anthropic/claude-sonnet-4.6",
4
5
  "anthropic/claude-haiku-4.5",
5
6
  "anthropic/claude-sonnet-4.5",
6
7
  "anthropic/claude-opus-4.5",
@@ -9,6 +9,7 @@ import { withCanonicalIds } from "../registry";
9
9
  const MAPPING = {
10
10
  // Require Inference Profiles and can't be resolved from standard name mapping
11
11
  "anthropic/claude-haiku-4.5": "{ip}anthropic.claude-haiku-4-5-20251001-v1:0",
12
+ "anthropic/claude-sonnet-4.6": "{ip}anthropic.claude-sonnet-4-6",
12
13
  "anthropic/claude-sonnet-4.5": "{ip}anthropic.claude-sonnet-4-5-20250929-v1:0",
13
14
  "anthropic/claude-opus-4.6": "{ip}anthropic.claude-opus-4-6-v1",
14
15
  "anthropic/claude-opus-4.5": "{ip}anthropic.claude-opus-4-5-20251101-v1:0",
@@ -1,4 +1,4 @@
1
- import { toOpenAIError } from "#/errors/openai";
1
+ import { toOpenAIError } from "../errors/openai";
2
2
  const isErrorChunk = (v) => v instanceof Error || !!v?.error;
3
3
  export const wrapStream = (src, hooks) => {
4
4
  let finished = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebo-ai/gateway",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "AI gateway as a framework. For full control over models, routing & lifecycle. OpenAI-compatible /chat/completions, /embeddings & /models.",
5
5
  "keywords": [
6
6
  "ai",
@@ -65,6 +65,18 @@ export const claudeSonnet45 = presetFor<CanonicalModelId, CatalogModel>()(
65
65
  } satisfies DeepPartial<CatalogModel>,
66
66
  );
67
67
 
68
+ export const claudeSonnet46 = presetFor<CanonicalModelId, CatalogModel>()(
69
+ "anthropic/claude-sonnet-4.6" as const,
70
+ {
71
+ ...CLAUDE_BASE,
72
+ ...CLAUDE_PDF_MODALITIES,
73
+ name: "Claude Sonnet 4.6",
74
+ capabilities: [...CLAUDE_BASE.capabilities, "reasoning"],
75
+ created: "2026-02-17",
76
+ knowledge: "2025-08",
77
+ } satisfies DeepPartial<CatalogModel>,
78
+ );
79
+
68
80
  export const claudeSonnet4 = presetFor<CanonicalModelId, CatalogModel>()(
69
81
  "anthropic/claude-sonnet-4" as const,
70
82
  {
@@ -149,7 +161,7 @@ export const claudeOpus4 = presetFor<CanonicalModelId, CatalogModel>()(
149
161
  );
150
162
 
151
163
  const claudeAtomic = {
152
- "v4.6": [claudeOpus46],
164
+ "v4.6": [claudeSonnet46, claudeOpus46],
153
165
  "v4.5": [claudeHaiku45, claudeSonnet45, claudeOpus45],
154
166
  "v4.1": [claudeOpus41],
155
167
  v4: [claudeSonnet4, claudeOpus4],
@@ -157,7 +169,7 @@ const claudeAtomic = {
157
169
  "v3.5": [claudeSonnet35, claudeHaiku35],
158
170
  v3: [claudeHaiku3],
159
171
  haiku: [claudeHaiku45, claudeHaiku35, claudeHaiku3],
160
- sonnet: [claudeSonnet45, claudeSonnet4, claudeSonnet37, claudeSonnet35],
172
+ sonnet: [claudeSonnet46, claudeSonnet45, claudeSonnet4, claudeSonnet37, claudeSonnet35],
161
173
  opus: [claudeOpus46, claudeOpus45, claudeOpus41, claudeOpus4],
162
174
  } as const;
163
175
 
@@ -3,6 +3,7 @@ import type { ProviderId } from "../providers/types";
3
3
  export const CANONICAL_MODEL_IDS = [
4
4
  // Anthropic
5
5
  "anthropic/claude-opus-4.6",
6
+ "anthropic/claude-sonnet-4.6",
6
7
  "anthropic/claude-haiku-4.5",
7
8
  "anthropic/claude-sonnet-4.5",
8
9
  "anthropic/claude-opus-4.5",
@@ -13,6 +13,7 @@ import { withCanonicalIds } from "../registry";
13
13
  const MAPPING = {
14
14
  // Require Inference Profiles and can't be resolved from standard name mapping
15
15
  "anthropic/claude-haiku-4.5": "{ip}anthropic.claude-haiku-4-5-20251001-v1:0",
16
+ "anthropic/claude-sonnet-4.6": "{ip}anthropic.claude-sonnet-4-6",
16
17
  "anthropic/claude-sonnet-4.5": "{ip}anthropic.claude-sonnet-4-5-20250929-v1:0",
17
18
  "anthropic/claude-opus-4.6": "{ip}anthropic.claude-opus-4-6-v1",
18
19
  "anthropic/claude-opus-4.5": "{ip}anthropic.claude-opus-4-5-20251101-v1:0",
@@ -1,4 +1,4 @@
1
- import { toOpenAIError } from "#/errors/openai";
1
+ import { toOpenAIError } from "../errors/openai";
2
2
 
3
3
  const isErrorChunk = (v: unknown) => v instanceof Error || !!(v as any)?.error;
4
4