@ai-sdk/amazon-bedrock 3.0.0-canary.9 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,514 @@
1
1
  # @ai-sdk/amazon-bedrock
2
2
 
3
+ ## 3.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [90d212f]
8
+ - @ai-sdk/provider-utils@3.0.1
9
+ - @ai-sdk/anthropic@2.0.1
10
+
11
+ ## 3.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - d5f588f: AI SDK 5
16
+
17
+ ### Patch Changes
18
+
19
+ - 97ea26f: chore(providers/bedrock): convert to providerOptions
20
+ - 97ea26f: chore(providers/bedrock): use camelCase for providerOptions
21
+ - 314edb2: Add API key authentication support for Amazon Bedrock with Bearer token and automatic SigV4 fallback
22
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
23
+ - e2aceaf: feat: add raw chunk support
24
+ - eb173f1: chore (providers): remove model shorthand deprecation warnings
25
+ - a89add7: fix(amazon-bedrock): add structured output support for claude models
26
+ - 26735b5: chore(embedding-model): add v2 interface
27
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
28
+ - 0893170: fix(amazon-bedrock): handle empty activeTools with tool conversation history
29
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
30
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
31
+ - a10bf62: Fixes "Extra inputs are not permitted" error when using reasoning with Bedrock
32
+ - 92c0b4b: chore(providers/bedrock): update embedding model to use providerOptions
33
+ - 3593385: fix(bedrock): resolve mime-types of document and images
34
+ - d1a034f: feature: using Zod 4 for internal stuff
35
+ - c87b7e4: feat (provider/amazon-bedrock): add Claude 4 model ids (claude-sonnet-4-20250514-v1:0, claude-opus-4-20250514-v1:0)
36
+ - d546725: fix(provider/amazon-bedrock): use consistent document names for prompt cache effectiveness
37
+ - b652872: fix(provider/bedrock): include toolConfig when conversation contains tool content
38
+ - 205077b: fix: improve Zod compatibility
39
+ - f418dd7: Added anthropic provider defined tool support to amazon bedrock
40
+ - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions
41
+ - 89eaf5e: Add style parameter support for Amazon Bedrock Nova Canvas image generation
42
+ - Updated dependencies [a571d6e]
43
+ - Updated dependencies [742b7be]
44
+ - Updated dependencies [e7fcc86]
45
+ - Updated dependencies [7cddb72]
46
+ - Updated dependencies [ccce59b]
47
+ - Updated dependencies [e2b9e4b]
48
+ - Updated dependencies [95857aa]
49
+ - Updated dependencies [45c1ea2]
50
+ - Updated dependencies [6f6bb89]
51
+ - Updated dependencies [ad66c0e]
52
+ - Updated dependencies [060370c]
53
+ - Updated dependencies [dc714f3]
54
+ - Updated dependencies [b5da06a]
55
+ - Updated dependencies [8f2854f]
56
+ - Updated dependencies [d1a1aa1]
57
+ - Updated dependencies [63f9e9b]
58
+ - Updated dependencies [5d142ab]
59
+ - Updated dependencies [d5f588f]
60
+ - Updated dependencies [e025824]
61
+ - Updated dependencies [0571b98]
62
+ - Updated dependencies [5d959e7]
63
+ - Updated dependencies [b6b43c7]
64
+ - Updated dependencies [4fef487]
65
+ - Updated dependencies [48d257a]
66
+ - Updated dependencies [0c0c0b3]
67
+ - Updated dependencies [0d2c085]
68
+ - Updated dependencies [40acf9b]
69
+ - Updated dependencies [9222aeb]
70
+ - Updated dependencies [8dfcb11]
71
+ - Updated dependencies [9f73965]
72
+ - Updated dependencies [e2aceaf]
73
+ - Updated dependencies [411e483]
74
+ - Updated dependencies [8ba77a7]
75
+ - Updated dependencies [fdff8a4]
76
+ - Updated dependencies [eb173f1]
77
+ - Updated dependencies [4f26d59]
78
+ - Updated dependencies [25f3454]
79
+ - Updated dependencies [a85c85f]
80
+ - Updated dependencies [7b3ae3f]
81
+ - Updated dependencies [a166433]
82
+ - Updated dependencies [26735b5]
83
+ - Updated dependencies [443d8ec]
84
+ - Updated dependencies [5c9eec4]
85
+ - Updated dependencies [a8c8bd5]
86
+ - Updated dependencies [abf9a79]
87
+ - Updated dependencies [14c9410]
88
+ - Updated dependencies [e86be6f]
89
+ - Updated dependencies [9bf7291]
90
+ - Updated dependencies [2e13791]
91
+ - Updated dependencies [9f95b35]
92
+ - Updated dependencies [66962ed]
93
+ - Updated dependencies [0d06df6]
94
+ - Updated dependencies [472524a]
95
+ - Updated dependencies [dd3ff01]
96
+ - Updated dependencies [d9c98f4]
97
+ - Updated dependencies [05d2819]
98
+ - Updated dependencies [9301f86]
99
+ - Updated dependencies [0a87932]
100
+ - Updated dependencies [c4a2fec]
101
+ - Updated dependencies [957b739]
102
+ - Updated dependencies [79457bd]
103
+ - Updated dependencies [a3f768e]
104
+ - Updated dependencies [7435eb5]
105
+ - Updated dependencies [8aa9e20]
106
+ - Updated dependencies [4617fab]
107
+ - Updated dependencies [075711d]
108
+ - Updated dependencies [ac34802]
109
+ - Updated dependencies [0054544]
110
+ - Updated dependencies [269683f]
111
+ - Updated dependencies [cb68df0]
112
+ - Updated dependencies [ad80501]
113
+ - Updated dependencies [68ecf2f]
114
+ - Updated dependencies [9e9c809]
115
+ - Updated dependencies [32831c6]
116
+ - Updated dependencies [6dc848c]
117
+ - Updated dependencies [6b98118]
118
+ - Updated dependencies [d0f9495]
119
+ - Updated dependencies [63d791d]
120
+ - Updated dependencies [87b828f]
121
+ - Updated dependencies [3f2f00c]
122
+ - Updated dependencies [d601ed9]
123
+ - Updated dependencies [bfdca8d]
124
+ - Updated dependencies [0ff02bb]
125
+ - Updated dependencies [b9ddcdd]
126
+ - Updated dependencies [91715e5]
127
+ - Updated dependencies [7979f7f]
128
+ - Updated dependencies [ca8aac6]
129
+ - Updated dependencies [39a4fab]
130
+ - Updated dependencies [44f4aba]
131
+ - Updated dependencies [61ab528]
132
+ - Updated dependencies [84577c8]
133
+ - Updated dependencies [9bd5ab5]
134
+ - Updated dependencies [57edfcb]
135
+ - Updated dependencies [faf8446]
136
+ - Updated dependencies [7ea4132]
137
+ - Updated dependencies [d1a034f]
138
+ - Updated dependencies [5c56081]
139
+ - Updated dependencies [fd65bc6]
140
+ - Updated dependencies [023ba40]
141
+ - Updated dependencies [ea7a7c9]
142
+ - Updated dependencies [26535e0]
143
+ - Updated dependencies [e030615]
144
+ - Updated dependencies [6392f60]
145
+ - Updated dependencies [5e57fae]
146
+ - Updated dependencies [393138b]
147
+ - Updated dependencies [c57e248]
148
+ - Updated dependencies [88a8ee5]
149
+ - Updated dependencies [41fa418]
150
+ - Updated dependencies [205077b]
151
+ - Updated dependencies [71f938d]
152
+ - Updated dependencies [3795467]
153
+ - Updated dependencies [28a5ed5]
154
+ - Updated dependencies [7182d14]
155
+ - Updated dependencies [ee5a9c0]
156
+ - Updated dependencies [f418dd7]
157
+ - Updated dependencies [c1e6647]
158
+ - Updated dependencies [1766ede]
159
+ - Updated dependencies [362b048]
160
+ - Updated dependencies [399e056]
161
+ - Updated dependencies [0b678b2]
162
+ - Updated dependencies [811dff3]
163
+ - Updated dependencies [f10304b]
164
+ - Updated dependencies [dd5fd43]
165
+ - Updated dependencies [a753b3a]
166
+ - Updated dependencies [33f4a6a]
167
+ - Updated dependencies [383cbfa]
168
+ - Updated dependencies [27deb4d]
169
+ - Updated dependencies [c4df419]
170
+ - @ai-sdk/provider-utils@3.0.0
171
+ - @ai-sdk/provider@2.0.0
172
+ - @ai-sdk/anthropic@2.0.0
173
+
174
+ ## 3.0.0-beta.15
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [88a8ee5]
179
+ - @ai-sdk/provider-utils@3.0.0-beta.10
180
+ - @ai-sdk/anthropic@2.0.0-beta.13
181
+
182
+ ## 3.0.0-beta.14
183
+
184
+ ### Patch Changes
185
+
186
+ - f418dd7: Added anthropic provider defined tool support to amazon bedrock
187
+ - Updated dependencies [f418dd7]
188
+ - Updated dependencies [27deb4d]
189
+ - @ai-sdk/anthropic@2.0.0-beta.12
190
+ - @ai-sdk/provider@2.0.0-beta.2
191
+ - @ai-sdk/provider-utils@3.0.0-beta.9
192
+
193
+ ## 3.0.0-beta.13
194
+
195
+ ### Patch Changes
196
+
197
+ - eb173f1: chore (providers): remove model shorthand deprecation warnings
198
+ - Updated dependencies [dd5fd43]
199
+ - @ai-sdk/provider-utils@3.0.0-beta.8
200
+
201
+ ## 3.0.0-beta.12
202
+
203
+ ### Patch Changes
204
+
205
+ - 0893170: fix(amazon-bedrock): handle empty activeTools with tool conversation history
206
+ - Updated dependencies [e7fcc86]
207
+ - @ai-sdk/provider-utils@3.0.0-beta.7
208
+
209
+ ## 3.0.0-beta.11
210
+
211
+ ### Patch Changes
212
+
213
+ - a89add7: fix(amazon-bedrock): add structured output support for claude models
214
+
215
+ ## 3.0.0-beta.10
216
+
217
+ ### Patch Changes
218
+
219
+ - b652872: fix(provider/bedrock): include toolConfig when conversation contains tool content
220
+ - Updated dependencies [ac34802]
221
+ - @ai-sdk/provider-utils@3.0.0-beta.6
222
+
223
+ ## 3.0.0-beta.9
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [57edfcb]
228
+ - Updated dependencies [383cbfa]
229
+ - @ai-sdk/provider-utils@3.0.0-beta.5
230
+
231
+ ## 3.0.0-beta.8
232
+
233
+ ### Patch Changes
234
+
235
+ - 205077b: fix: improve Zod compatibility
236
+ - Updated dependencies [205077b]
237
+ - @ai-sdk/provider-utils@3.0.0-beta.4
238
+
239
+ ## 3.0.0-beta.7
240
+
241
+ ### Patch Changes
242
+
243
+ - 314edb2: Add API key authentication support for Amazon Bedrock with Bearer token and automatic SigV4 fallback
244
+
245
+ ## 3.0.0-beta.6
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [05d2819]
250
+ - @ai-sdk/provider-utils@3.0.0-beta.3
251
+
252
+ ## 3.0.0-beta.5
253
+
254
+ ### Patch Changes
255
+
256
+ - 89eaf5e: Add style parameter support for Amazon Bedrock Nova Canvas image generation
257
+
258
+ ## 3.0.0-beta.4
259
+
260
+ ### Patch Changes
261
+
262
+ - a10bf62: Fixes "Extra inputs are not permitted" error when using reasoning with Bedrock
263
+
264
+ ## 3.0.0-beta.3
265
+
266
+ ### Patch Changes
267
+
268
+ - 3593385: fix(bedrock): resolve mime-types of document and images
269
+
270
+ ## 3.0.0-beta.2
271
+
272
+ ### Patch Changes
273
+
274
+ - d1a034f: feature: using Zod 4 for internal stuff
275
+ - Updated dependencies [0571b98]
276
+ - Updated dependencies [39a4fab]
277
+ - Updated dependencies [d1a034f]
278
+ - @ai-sdk/provider-utils@3.0.0-beta.2
279
+
280
+ ## 3.0.0-beta.1
281
+
282
+ ### Patch Changes
283
+
284
+ - Updated dependencies [742b7be]
285
+ - Updated dependencies [7cddb72]
286
+ - Updated dependencies [ccce59b]
287
+ - Updated dependencies [e2b9e4b]
288
+ - Updated dependencies [45c1ea2]
289
+ - Updated dependencies [e025824]
290
+ - Updated dependencies [0d06df6]
291
+ - Updated dependencies [472524a]
292
+ - Updated dependencies [dd3ff01]
293
+ - Updated dependencies [7435eb5]
294
+ - Updated dependencies [cb68df0]
295
+ - Updated dependencies [bfdca8d]
296
+ - Updated dependencies [44f4aba]
297
+ - Updated dependencies [023ba40]
298
+ - Updated dependencies [5e57fae]
299
+ - Updated dependencies [71f938d]
300
+ - Updated dependencies [28a5ed5]
301
+ - @ai-sdk/provider@2.0.0-beta.1
302
+ - @ai-sdk/provider-utils@3.0.0-beta.1
303
+
304
+ ## 3.0.0-alpha.15
305
+
306
+ ### Patch Changes
307
+
308
+ - Updated dependencies [48d257a]
309
+ - Updated dependencies [8ba77a7]
310
+ - @ai-sdk/provider@2.0.0-alpha.15
311
+ - @ai-sdk/provider-utils@3.0.0-alpha.15
312
+
313
+ ## 3.0.0-alpha.14
314
+
315
+ ### Patch Changes
316
+
317
+ - Updated dependencies [b5da06a]
318
+ - Updated dependencies [63f9e9b]
319
+ - Updated dependencies [2e13791]
320
+ - @ai-sdk/provider@2.0.0-alpha.14
321
+ - @ai-sdk/provider-utils@3.0.0-alpha.14
322
+
323
+ ## 3.0.0-alpha.13
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies [68ecf2f]
328
+ - @ai-sdk/provider@2.0.0-alpha.13
329
+ - @ai-sdk/provider-utils@3.0.0-alpha.13
330
+
331
+ ## 3.0.0-alpha.12
332
+
333
+ ### Patch Changes
334
+
335
+ - e2aceaf: feat: add raw chunk support
336
+ - Updated dependencies [e2aceaf]
337
+ - @ai-sdk/provider@2.0.0-alpha.12
338
+ - @ai-sdk/provider-utils@3.0.0-alpha.12
339
+
340
+ ## 3.0.0-alpha.11
341
+
342
+ ### Patch Changes
343
+
344
+ - d546725: fix(provider/amazon-bedrock): use consistent document names for prompt cache effectiveness
345
+ - Updated dependencies [c1e6647]
346
+ - @ai-sdk/provider@2.0.0-alpha.11
347
+ - @ai-sdk/provider-utils@3.0.0-alpha.11
348
+
349
+ ## 3.0.0-alpha.10
350
+
351
+ ### Patch Changes
352
+
353
+ - Updated dependencies [c4df419]
354
+ - @ai-sdk/provider@2.0.0-alpha.10
355
+ - @ai-sdk/provider-utils@3.0.0-alpha.10
356
+
357
+ ## 3.0.0-alpha.9
358
+
359
+ ### Patch Changes
360
+
361
+ - c87b7e4: feat (provider/amazon-bedrock): add Claude 4 model ids (claude-sonnet-4-20250514-v1:0, claude-opus-4-20250514-v1:0)
362
+ - Updated dependencies [811dff3]
363
+ - @ai-sdk/provider@2.0.0-alpha.9
364
+ - @ai-sdk/provider-utils@3.0.0-alpha.9
365
+
366
+ ## 3.0.0-alpha.8
367
+
368
+ ### Patch Changes
369
+
370
+ - Updated dependencies [4fef487]
371
+ - Updated dependencies [9222aeb]
372
+ - @ai-sdk/provider-utils@3.0.0-alpha.8
373
+ - @ai-sdk/provider@2.0.0-alpha.8
374
+
375
+ ## 3.0.0-alpha.7
376
+
377
+ ### Patch Changes
378
+
379
+ - Updated dependencies [5c56081]
380
+ - @ai-sdk/provider@2.0.0-alpha.7
381
+ - @ai-sdk/provider-utils@3.0.0-alpha.7
382
+
383
+ ## 3.0.0-alpha.6
384
+
385
+ ### Patch Changes
386
+
387
+ - Updated dependencies [0d2c085]
388
+ - @ai-sdk/provider@2.0.0-alpha.6
389
+ - @ai-sdk/provider-utils@3.0.0-alpha.6
390
+
391
+ ## 3.0.0-alpha.4
392
+
393
+ ### Patch Changes
394
+
395
+ - Updated dependencies [dc714f3]
396
+ - @ai-sdk/provider@2.0.0-alpha.4
397
+ - @ai-sdk/provider-utils@3.0.0-alpha.4
398
+
399
+ ## 3.0.0-alpha.3
400
+
401
+ ### Patch Changes
402
+
403
+ - Updated dependencies [6b98118]
404
+ - @ai-sdk/provider@2.0.0-alpha.3
405
+ - @ai-sdk/provider-utils@3.0.0-alpha.3
406
+
407
+ ## 3.0.0-alpha.2
408
+
409
+ ### Patch Changes
410
+
411
+ - Updated dependencies [26535e0]
412
+ - @ai-sdk/provider@2.0.0-alpha.2
413
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
414
+
415
+ ## 3.0.0-alpha.1
416
+
417
+ ### Patch Changes
418
+
419
+ - Updated dependencies [3f2f00c]
420
+ - @ai-sdk/provider@2.0.0-alpha.1
421
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
422
+
423
+ ## 3.0.0-canary.19
424
+
425
+ ### Patch Changes
426
+
427
+ - Updated dependencies [faf8446]
428
+ - @ai-sdk/provider-utils@3.0.0-canary.19
429
+
430
+ ## 3.0.0-canary.18
431
+
432
+ ### Patch Changes
433
+
434
+ - Updated dependencies [40acf9b]
435
+ - @ai-sdk/provider-utils@3.0.0-canary.18
436
+
437
+ ## 3.0.0-canary.17
438
+
439
+ ### Patch Changes
440
+
441
+ - Updated dependencies [ea7a7c9]
442
+ - @ai-sdk/provider-utils@3.0.0-canary.17
443
+
444
+ ## 3.0.0-canary.16
445
+
446
+ ### Patch Changes
447
+
448
+ - Updated dependencies [87b828f]
449
+ - @ai-sdk/provider-utils@3.0.0-canary.16
450
+
451
+ ## 3.0.0-canary.15
452
+
453
+ ### Patch Changes
454
+
455
+ - a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
456
+ - 6f231db: fix(providers): always use optional instead of mix of nullish for providerOptions
457
+ - Updated dependencies [a571d6e]
458
+ - Updated dependencies [a8c8bd5]
459
+ - Updated dependencies [7979f7f]
460
+ - Updated dependencies [41fa418]
461
+ - @ai-sdk/provider-utils@3.0.0-canary.15
462
+ - @ai-sdk/provider@2.0.0-canary.14
463
+
464
+ ## 3.0.0-canary.14
465
+
466
+ ### Patch Changes
467
+
468
+ - Updated dependencies [957b739]
469
+ - Updated dependencies [9bd5ab5]
470
+ - @ai-sdk/provider-utils@3.0.0-canary.14
471
+ - @ai-sdk/provider@2.0.0-canary.13
472
+
473
+ ## 3.0.0-canary.13
474
+
475
+ ### Patch Changes
476
+
477
+ - d9209ca: fix (image-model): `specificationVersion: v1` -> `v2`
478
+ - Updated dependencies [7b3ae3f]
479
+ - Updated dependencies [0ff02bb]
480
+ - @ai-sdk/provider@2.0.0-canary.12
481
+ - @ai-sdk/provider-utils@3.0.0-canary.13
482
+
483
+ ## 3.0.0-canary.12
484
+
485
+ ### Patch Changes
486
+
487
+ - Updated dependencies [9bf7291]
488
+ - Updated dependencies [4617fab]
489
+ - Updated dependencies [e030615]
490
+ - @ai-sdk/provider@2.0.0-canary.11
491
+ - @ai-sdk/provider-utils@3.0.0-canary.12
492
+
493
+ ## 3.0.0-canary.11
494
+
495
+ ### Patch Changes
496
+
497
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
498
+ - Updated dependencies [66962ed]
499
+ - Updated dependencies [9301f86]
500
+ - Updated dependencies [a3f768e]
501
+ - @ai-sdk/provider-utils@3.0.0-canary.11
502
+ - @ai-sdk/provider@2.0.0-canary.10
503
+
504
+ ## 3.0.0-canary.10
505
+
506
+ ### Patch Changes
507
+
508
+ - Updated dependencies [e86be6f]
509
+ - @ai-sdk/provider@2.0.0-canary.9
510
+ - @ai-sdk/provider-utils@3.0.0-canary.10
511
+
3
512
  ## 3.0.0-canary.9
4
513
 
5
514
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI SDK - Amazon Bedrock Provider
2
2
 
3
- The **[Amazon Bedrock provider](https://sdk.vercel.ai/providers/ai-sdk-providers/amazon-bedrock)** for the [AI SDK](https://sdk.vercel.ai/docs)
3
+ The **[Amazon Bedrock provider](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the Amazon Bedrock [converse API](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html).
5
5
 
6
6
  ## Setup
@@ -19,6 +19,81 @@ You can import the default provider instance `bedrock` from `@ai-sdk/amazon-bedr
19
19
  import { bedrock } from '@ai-sdk/amazon-bedrock';
20
20
  ```
21
21
 
22
+ ## Authentication
23
+
24
+ The Amazon Bedrock provider supports two authentication methods with automatic fallback:
25
+
26
+ ### API Key Authentication (Recommended)
27
+
28
+ API key authentication provides a simpler setup process compared to traditional AWS SigV4 authentication. You can authenticate using either environment variables or direct configuration.
29
+
30
+ #### Using Environment Variable
31
+
32
+ Set the `AWS_BEARER_TOKEN_BEDROCK` environment variable with your API key:
33
+
34
+ ```bash
35
+ export AWS_BEARER_TOKEN_BEDROCK=your-api-key-here
36
+ ```
37
+
38
+ ```ts
39
+ import { bedrock } from '@ai-sdk/amazon-bedrock';
40
+ import { generateText } from 'ai';
41
+
42
+ const { text } = await generateText({
43
+ model: bedrock('anthropic.claude-3-haiku-20240307-v1:0'),
44
+ prompt: 'Write a vegetarian lasagna recipe for 4 people.',
45
+ // API key is automatically loaded from AWS_BEARER_TOKEN_BEDROCK
46
+ });
47
+ ```
48
+
49
+ #### Using Direct Configuration
50
+
51
+ You can also pass the API key directly in the provider configuration:
52
+
53
+ ```ts
54
+ import { bedrock } from '@ai-sdk/amazon-bedrock';
55
+ import { generateText } from 'ai';
56
+
57
+ const bedrockWithApiKey = bedrock.withSettings({
58
+ apiKey: process.env.AWS_BEARER_TOKEN_BEDROCK, // or your API key directly
59
+ region: 'us-east-1', // Optional: specify region
60
+ });
61
+
62
+ const { text } = await generateText({
63
+ model: bedrockWithApiKey('anthropic.claude-3-haiku-20240307-v1:0'),
64
+ prompt: 'Write a vegetarian lasagna recipe for 4 people.',
65
+ });
66
+ ```
67
+
68
+ ### SigV4 Authentication (Fallback)
69
+
70
+ If no API key is provided, the provider automatically falls back to AWS SigV4 authentication using standard AWS credentials:
71
+
72
+ ```ts
73
+ import { bedrock } from '@ai-sdk/amazon-bedrock';
74
+ import { generateText } from 'ai';
75
+
76
+ // Uses AWS credentials from environment variables or AWS credential chain
77
+ const { text } = await generateText({
78
+ model: bedrock('anthropic.claude-3-haiku-20240307-v1:0'),
79
+ prompt: 'Write a vegetarian lasagna recipe for 4 people.',
80
+ });
81
+ ```
82
+
83
+ This method requires standard AWS environment variables:
84
+
85
+ - `AWS_ACCESS_KEY_ID`
86
+ - `AWS_SECRET_ACCESS_KEY`
87
+ - `AWS_SESSION_TOKEN` (optional, for temporary credentials)
88
+
89
+ ### Authentication Precedence
90
+
91
+ The provider uses the following authentication precedence:
92
+
93
+ 1. **API key from direct configuration** (`apiKey` in `withSettings()`)
94
+ 2. **API key from environment variable** (`AWS_BEARER_TOKEN_BEDROCK`)
95
+ 3. **SigV4 authentication** (AWS credential chain fallback)
96
+
22
97
  ## Example
23
98
 
24
99
  ```ts
@@ -33,4 +108,4 @@ const { text } = await generateText({
33
108
 
34
109
  ## Documentation
35
110
 
36
- Please check out the **[Amazon Bedrock provider documentation](https://sdk.vercel.ai/providers/ai-sdk-providers/amazon-bedrock)** for more information.
111
+ Please check out the **[Amazon Bedrock provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/amazon-bedrock)** for more information.