@ai-sdk/amazon-bedrock 3.0.0-canary.9 → 3.0.0

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