Skip to content

Commit f298383

Browse files
vapi-tasker[bot]Vapi Taskerclaude
authored
docs: add Anthropic Bedrock integration page (#901)
* docs: add Anthropic Bedrock integration page Add documentation for using Anthropic Claude models via AWS Bedrock with Vapi. The guide covers: - IAM role creation and configuration - Trust policy setup with Vapi AWS Account ID (533267069243) - Permissions policies (broad and restrictive options) - Vapi credential creation via API - External ID handling (user-provided or Vapi-generated) - Troubleshooting common errors Co-Authored-By: Claude <noreply@anthropic.com> * fix: correct External ID documentation - it's optional, not Vapi-generated - External ID is optional, Vapi does NOT generate it - Added tabs showing trust policy with and without External ID - Removed step about updating trust policy with Vapi-generated ID - Updated troubleshooting section Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Vapi Tasker <tasker@vapi.ai> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6d64ca1 commit f298383

2 files changed

Lines changed: 241 additions & 0 deletions

File tree

fern/docs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ navigation:
586586
path: providers/model/openai.mdx
587587
- page: Azure OpenAI
588588
path: providers/model/azure-openai.mdx
589+
- page: Anthropic Bedrock
590+
path: providers/model/anthropic-bedrock.mdx
589591
- page: Gemini
590592
path: providers/model/gemini.mdx
591593
- page: Groq
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
---
2+
title: Anthropic Bedrock
3+
subtitle: Use Anthropic Claude models via AWS Bedrock with your own AWS resources
4+
slug: providers/model/anthropic-bedrock
5+
---
6+
7+
**What is Anthropic Bedrock?**
8+
9+
Amazon Bedrock is a fully managed service that provides access to foundation models from leading AI companies, including Anthropic's Claude models. With Bedrock, you can use Claude models through AWS infrastructure, benefiting from enterprise-grade security, regional data residency, and seamless integration with your existing AWS environment.
10+
11+
**Custom Anthropic Bedrock Integration with Vapi:**
12+
13+
Vapi's Anthropic Bedrock integration allows you to connect your own AWS Bedrock resources to power voice assistants with Claude models. This enables you to maintain full control over your AWS billing, use your own rate limits, and ensure data stays within your AWS environment.
14+
15+
## Prerequisites
16+
17+
Before configuring Anthropic Bedrock with Vapi, ensure you have:
18+
19+
- An active AWS account with Bedrock access enabled
20+
- Model access granted for Anthropic Claude models in your Bedrock console
21+
- IAM permissions to create roles and policies
22+
23+
## Configuration steps
24+
25+
<Steps>
26+
<Step title="Create an IAM Role in AWS">
27+
Create a new IAM role that Vapi will assume to access your Bedrock resources.
28+
29+
1. Go to the **IAM Console** in AWS
30+
2. Navigate to **Roles** and click **Create role**
31+
3. Select **Custom trust policy** as the trusted entity type
32+
4. Add the trust policy from the next step
33+
34+
<Note>
35+
Choose a descriptive name for your role, such as `VapiBedrockRole`, so you can easily identify its purpose.
36+
</Note>
37+
</Step>
38+
39+
<Step title="Attach the Trust Policy">
40+
Configure the trust policy to allow Vapi's AWS account to assume this role.
41+
42+
<Tabs>
43+
<Tab title="Without External ID">
44+
Use this simpler policy if you don't need the additional security of an External ID:
45+
46+
```json title="Trust Policy (Basic)"
47+
{
48+
"Version": "2012-10-17",
49+
"Statement": [
50+
{
51+
"Effect": "Allow",
52+
"Principal": {
53+
"AWS": "arn:aws:iam::533267069243:root"
54+
},
55+
"Action": "sts:AssumeRole"
56+
}
57+
]
58+
}
59+
```
60+
</Tab>
61+
<Tab title="With External ID">
62+
Use this policy if you want the additional security of an External ID:
63+
64+
```json title="Trust Policy (With External ID)"
65+
{
66+
"Version": "2012-10-17",
67+
"Statement": [
68+
{
69+
"Effect": "Allow",
70+
"Principal": {
71+
"AWS": "arn:aws:iam::533267069243:root"
72+
},
73+
"Action": "sts:AssumeRole",
74+
"Condition": {
75+
"StringEquals": {
76+
"sts:ExternalId": "YOUR_EXTERNAL_ID"
77+
}
78+
}
79+
}
80+
]
81+
}
82+
```
83+
84+
Replace `YOUR_EXTERNAL_ID` with your chosen value. You'll use the same value when creating the Vapi credential.
85+
</Tab>
86+
</Tabs>
87+
88+
<Note>
89+
**About External ID**: The External ID is an optional security feature that provides an additional layer of protection for cross-account access. If you choose to use one, specify the same value in both your IAM trust policy and the Vapi credential configuration.
90+
</Note>
91+
</Step>
92+
93+
<Step title="Attach the Permissions Policy">
94+
Create and attach a permissions policy that grants access to Bedrock model invocation.
95+
96+
<Tabs>
97+
<Tab title="Broad Access">
98+
Use this policy to grant access to all Anthropic models across all regions:
99+
100+
```json title="Permissions Policy (All Models)"
101+
{
102+
"Version": "2012-10-17",
103+
"Statement": [
104+
{
105+
"Effect": "Allow",
106+
"Action": [
107+
"bedrock:InvokeModel",
108+
"bedrock:InvokeModelWithResponseStream"
109+
],
110+
"Resource": [
111+
"arn:aws:bedrock:*::foundation-model/anthropic.*",
112+
"arn:aws:bedrock:*:*:inference-profile/us.anthropic.*"
113+
]
114+
}
115+
]
116+
}
117+
```
118+
</Tab>
119+
<Tab title="Restrictive Access">
120+
Use this policy to limit access to specific models and regions:
121+
122+
```json title="Permissions Policy (Specific Models)"
123+
{
124+
"Version": "2012-10-17",
125+
"Statement": [
126+
{
127+
"Effect": "Allow",
128+
"Action": [
129+
"bedrock:InvokeModel",
130+
"bedrock:InvokeModelWithResponseStream"
131+
],
132+
"Resource": [
133+
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-5-sonnet-*",
134+
"arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-7-sonnet-*",
135+
"arn:aws:bedrock:us-east-1:*:inference-profile/us.anthropic.claude-3-5-sonnet-*",
136+
"arn:aws:bedrock:us-east-1:*:inference-profile/us.anthropic.claude-3-7-sonnet-*"
137+
]
138+
}
139+
]
140+
}
141+
```
142+
143+
<Tip>
144+
Replace `us-east-1` with your preferred AWS region. You can also add or remove specific model versions based on your needs.
145+
</Tip>
146+
</Tab>
147+
</Tabs>
148+
149+
To attach the policy:
150+
1. In the IAM Console, go to **Policies** and click **Create policy**
151+
2. Select **JSON** and paste your chosen policy
152+
3. Name the policy (e.g., `VapiBedrockInvokePolicy`)
153+
4. Attach the policy to your IAM role
154+
</Step>
155+
156+
<Step title="Create the Vapi Credential">
157+
Use the Vapi API to create a credential with your AWS role information:
158+
159+
```bash title="Create Credential via API"
160+
curl -X POST "https://api.vapi.ai/credential" \
161+
-H "Authorization: Bearer YOUR_VAPI_API_KEY" \
162+
-H "Content-Type: application/json" \
163+
-d '{
164+
"provider": "anthropic-bedrock",
165+
"region": "us-east-1",
166+
"authenticationPlan": {
167+
"type": "aws-sts",
168+
"roleArn": "arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/VapiBedrockRole",
169+
"externalId": "your-optional-external-id"
170+
}
171+
}'
172+
```
173+
174+
| Field | Description |
175+
|-------|-------------|
176+
| `provider` | Must be `anthropic-bedrock` |
177+
| `region` | AWS region where Bedrock is enabled (e.g., `us-east-1`) |
178+
| `authenticationPlan.type` | Must be `aws-sts` for role assumption |
179+
| `authenticationPlan.roleArn` | The ARN of the IAM role you created |
180+
| `authenticationPlan.externalId` | Optional: Your chosen External ID for additional security |
181+
182+
<Tip>
183+
If you don't need an External ID, you can remove the `Condition` block from your trust policy entirely.
184+
</Tip>
185+
</Step>
186+
</Steps>
187+
188+
## Example credential configuration
189+
190+
Here is a complete example of a Vapi credential configuration for Anthropic Bedrock:
191+
192+
```json title="Credential Configuration"
193+
{
194+
"provider": "anthropic-bedrock",
195+
"region": "us-east-1",
196+
"authenticationPlan": {
197+
"type": "aws-sts",
198+
"roleArn": "arn:aws:iam::123456789012:role/VapiBedrockRole",
199+
"externalId": "my-secure-external-id"
200+
}
201+
}
202+
```
203+
204+
## Benefits of using Anthropic Bedrock
205+
206+
**Enterprise security:**
207+
- Data residency control with regional deployments
208+
- Enterprise-grade security and compliance (SOC 2, HIPAA eligible, etc.)
209+
- Private VPC connectivity options through AWS
210+
211+
**Custom rate limits:**
212+
- Use your own AWS Bedrock quotas and rate limits
213+
- Avoid shared resource constraints
214+
- Predictable costs and billing through AWS
215+
216+
**AWS ecosystem integration:**
217+
- Seamless integration with existing AWS infrastructure
218+
- Use AWS CloudWatch for monitoring and logging
219+
- Leverage AWS IAM for fine-grained access control
220+
221+
## Troubleshooting
222+
223+
### Common error: "Access Denied"
224+
- **Cause**: The IAM role trust policy doesn't allow Vapi to assume the role
225+
- **Solution**: Verify the trust policy includes Vapi's AWS account ID (`533267069243`) and the correct External ID
226+
227+
### Common error: "Invalid External ID"
228+
- **Cause**: The External ID in your trust policy doesn't match the one in your Vapi credential
229+
- **Solution**: Ensure the `externalId` value in your Vapi credential exactly matches the `sts:ExternalId` in your IAM trust policy. If you're not using an External ID, remove the `Condition` block from your trust policy
230+
231+
### Common error: "Model access denied"
232+
- **Cause**: The IAM permissions policy doesn't grant access to the requested model, or model access isn't enabled in Bedrock
233+
- **Solution**:
234+
1. Verify the permissions policy includes the correct model ARNs
235+
2. Ensure you've enabled access to the model in the AWS Bedrock console
236+
237+
### Common error: "Region not supported"
238+
- **Cause**: The specified region doesn't have Bedrock or the requested model available
239+
- **Solution**: Use a supported region such as `us-east-1`, `us-west-2`, or `eu-west-1`

0 commit comments

Comments
 (0)