docs/customize/model-providers/top-level/bedrock.mdx
models: - name: <MODEL_NAME> provider: bedrock model: <MODEL_ID> env: region: us-east-1 profile: bedrock roles: - chat
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<MODEL_NAME>",
"provider": "bedrock",
"model": "<MODEL_ID>",
"region": "us-east-1",
"profile": "bedrock"
}
]
}
Bedrock allows Claude models to cache tool payloads, system messages, and chat
messages between requests. Enable this behavior by adding
promptCaching: true under defaultCompletionOptions in your model
configuration.
name: My Config
version: 0.0.1
schema: v1
models:
- name: <MODEL_NAME>
provider: bedrock
model: <MODEL_ID>
defaultCompletionOptions:
promptCaching: true
Prompt caching is not supported in JSON configuration files, so use the YAML syntax above to enable it.
Bedrock API keys let you authenticate without IAM credentials. Set your API key via the apiKey field:
models:
- name: Claude Sonnet
provider: bedrock
model: us.anthropic.claude-sonnet-4-20250514-v1:0
apiKey: ${{ secrets.BEDROCK_API_KEY }}
env:
region: us-east-1
roles:
- chat
Authentication will be through temporary or long-term credentials in
~/.aws/credentials under a configured profile (e.g. "bedrock").
[bedrock]
aws_access_key_id = abcdefg
aws_secret_access_key = hijklmno
aws_session_token = pqrstuvwxyz # Optional: means short term creds.
You can also use an AWS accessKeyId and secretAccessKey for authentication instead of a local credentials profile.
models: - name: <MODEL_NAME> provider: bedrock model: <MODEL_ID> env: region: us-east-1 accessKeyId: ${{ secrets.AWS_ACCESS_KEY_ID }} # can also enter key inline here for local configs secretAccessKey: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # can also enter key inline here for local configs roles: - chat
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<MODEL_NAME>",
"provider": "bedrock",
"model": "<MODEL_ID>",
"region": "us-east-1",
"accessKeyId": "<YOUR_ACCESS_KEY_ID>",
"secretAccessKey": "<YOUR_SECRET_ACCESS_KEY>"
}
]
}
To setup Bedrock using custom imported models, add the following to your config file:
<Tabs> <Tab title="YAML"> ```yaml title="config.yaml" name: My Config version: 0.0.1 schema: v1models: - name: <MODEL_NAME> provider: bedrockimport model: <MODEL_ID> env: region: us-west-2 profile: bedrock modelArn: arn:aws:bedrock:us-west-2:XXXXX:imported-model/XXXXXX
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "<MODEL_NAME>",
"provider": "bedrockimport",
"model": "<MODEL_ID>",
"modelArn": "arn:aws:bedrock:us-west-2:XXXXX:imported-model/XXXXXX",
"region": "us-west-2",
"profile": "bedrock"
}
]
}
Authentication will be through temporary or long-term credentials in ~/.aws/credentials under a configured profile (e.g. "bedrock").
[bedrock]
aws_access_key_id = abcdefg
aws_secret_access_key = hijklmno
aws_session_token = pqrstuvwxyz # Optional: means short term creds.