Configure Codex to use AWS Bedrock
January 1, 2026
•If you’d like Codex to use AWS Bedrock (say because your employer has an AWS account but not an OpenAI account), follow the steps below.
Install codex (if you haven’t already) https://developers.openai.com/codex/cli/
Visit your Bedrock dashboard and generate an API key https://607420117092-ntzqekvz.us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/api-keys?tab=long-term
Open Codex’s config file
nano ~/.codex/config.toml
Add a model provider and configure Codex to the use that model provider by default( I chose to name that model provider as bedrock but you can give it a different name, say employer-bedrock, if you’d like)
model_provider = "bedrock"
model = "openai.gpt-oss-120b"
[model_providers.bedrock]
name = "bedrock"
base_url = "https://bedrock-mantle.us-east-1.api.aws/v1"
api_key = "bedrock-api-key"
wire_api = "responses"
Start codex
codex
The config file above configures Codex to use OpenAI’s openai.gpt-oss-120b model. If you’d like to try a different model, run
curl https://bedrock-mantle.us-east-1.api.aws/v1/models -H "Authorization: Bearer bedrock-api-key"
to list all available models in AWS Bedrock and change the model configuration option in the Codex config file.
If you’re just experimenting and prefer Codex to not use Bedrock by default, add a profile to your Codex config file (I chose to name the profile too as bedrock but you can give it a different name, say employer-bedrock-gpt-oss-120b, if you’d like)
[model_providers.bedrock]
name = "bedrock"
base_url = "https://bedrock-mantle.us-east-1.api.aws/v1"
api_key = "bedrock-api-key"
wire_api = "responses"
[profiles.bedrock]
model_provider = "bedrock"
model = "openai.gpt-oss-120b"
and run
codex -p bedrock
Visit OpenAI’s docs https://developers.openai.com/codex/config-basic and AWS Bedrock’s docs https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html for information on configuration options and features.