# Using AWS Bedrock with opencode

> Setup your opencode CLI to work with AWS Bedrock foundational models

- Canonical: https://dennisokeeffe.com/blog/2025-11-19-using-aws-bedrock-with-opencode
- Published: 2025-11-19
- Updated: 2025-11-19
- Tags: aws, ai

[opencode](https://github.com/sst/opencode) is a AI coding agent built for the terminal.

It's extensible nature means that we can configure our own models. This is where [AWS Bedrock](https://aws.amazon.com/bedrock/), an AWS offering for foundational models and agent tools, comes in.

## Using AWS Bedrock with opencode

opencode (v1.0.68) will automatically enable AWS Bedrock model selection within the CLI if your terminal environment exports the expected enviornment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION`). Personally, I make use of [aws-vault](https://github.com/99designs/aws-vault) for managing this.

![opencode Bedrock models](https://cdn.dennisokeeffe.com/assets/2025-11-19-using-aws-bedrock-with-opencode/1-opencode.webp)

## AWS Bedrock Foundational models

For some foundational models (such as Claude models), you need to head to Bedrock on the AWS console and submit the use cases for Anthropic.

![Use case form for Anthropic](https://cdn.dennisokeeffe.com/assets/2025-11-19-using-aws-bedrock-with-opencode/2-use-case-form.webp)

This is a requirement for usage of those models in opencode.

## Links and Further Reading

- [opencode](https://github.com/sst/opencode)
- [AWS Bedrock](https://aws.amazon.com/bedrock/)
- [aws-vault](https://github.com/99designs/aws-vault)

_Photo credit: [`johnnyb803`](https://unsplash.com/@johnnyb803)_
