1# Use Codex with Amazon Bedrock
2
3Configure Codex to use OpenAI models available through Amazon Bedrock. In this
4setup, Codex runs locally and sends model requests to Bedrock using
5AWS-managed authentication and access controls.
6
7## How it works
8
9When you configure Codex with Amazon Bedrock as the model provider, the
10OpenAI-hosted Responses API isn’t in the request path. Codex sends model
11requests to Amazon Bedrock, and Bedrock provides an OpenAI-compatible Responses
12API implementation for supported OpenAI models.
13
14Authentication is AWS-native. Users authenticate with a Bedrock API key or AWS
15IAM credentials. They do not use ChatGPT sign-in or `OPENAI_API_KEY` for this
16provider.
17
18## Before you start
19
20Make sure you have:
21
22- Access to supported OpenAI models in Amazon Bedrock.
23- An AWS Region where the selected model is available.
24- Authentication for the Amazon Bedrock Mantle path configured for the AWS
25 account.
26
27## Configure Codex
28
29Add the `amazon-bedrock` model provider for the Amazon Bedrock Mantle path to
30`~/.codex/config.toml`. Supplying a model is optional. Select a supported model
31explicitly when needed.
32
33```
34model_provider = "amazon-bedrock"
35```
36
37This guide covers the Amazon Bedrock Mantle path in supported commercial AWS
38Regions. Codex doesn’t support Bedrock Mantle endpoints in AWS GovCloud
39Regions.
40
41## Authentication options
42
43Codex supports two Bedrock authentication paths. It checks them in this order:
44
451. Bedrock API key.
462. AWS SDK credential chain.
47
48### Option 1: Bedrock API key
49
50Set the Bedrock API key in the environment Codex reads. You must specify a
51Region when using API-key authentication.
52
53```
54export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
55export AWS_REGION=us-east-2
56```
57
58### Option 2: AWS SDK credentials
59
60Use this path when your organization manages Bedrock access through the AWS SDK
61credential chain. Codex can use these standard AWS SDK credential sources:
62
631. Shared AWS `config` and `credentials` files.
64
65 ```
66 aws configure
67 ```
682. Environment variables.
69
70 ```
71 export AWS_ACCESS_KEY_ID=<your-access-key-id>
72 export AWS_SECRET_ACCESS_KEY=<your-secret-access-key>
73 export AWS_SESSION_TOKEN=<your-session-token>
74 ```
753. AWS Management Console credentials.
76
77 ```
78 aws login
79 ```
804. AWS SSO or a named profile.
81
82 ```
83 aws sso login --profile codex-bedrock
84 export AWS_PROFILE=codex-bedrock
85 ```
865. Federated identity configured with `credential_process`. For corporate SSO or
87 OIDC federation, configure the AWS profile outside Codex and let the AWS SDK
88 resolve credentials. Put browser login, token exchange, caching, and refresh
89 in your AWS profile’s `credential_process` helper.
90
91## Desktop app and VS Code extension
92
93Desktop apps and IDE extensions may not inherit environment variables from the
94shell. Put required values in `~/.codex/.env`, then restart the app or
95extension.
96
97```
98export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
99export AWS_REGION=us-east-2
100```
101
102## Verify setup
103
104- In Codex CLI, open `/status` and confirm Codex is using the
105 `amazon-bedrock` model provider.
106- In the desktop app or VS Code extension, start a new session after restarting
107 the app.
108- Confirm the selected model is available in the configured AWS Region and that
109 the AWS identity has permission to access it.
110
111## Supported models
112
113Use exact model IDs:
114
115```
116openai.gpt-5.5
117openai.gpt-5.4
118```
119
120Model availability varies by AWS Region. Before selecting a model, see [model
121support by AWS
122Region](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html).
123
124## Feature availability
125
126This configuration supports local Codex workflows. Some features that depend on
127OpenAI-hosted cloud services, hosted tools, or cloud-managed discovery aren’t
128currently available.
129
130Fast Mode isn’t available with Amazon Bedrock. Fast Mode uses priority
131processing, and the initial Amazon Bedrock offering supports on-demand
132inference only.
133
134Detailed feature availability
135
136| Feature | Amazon Bedrock |
137| --- | --- |
138| Access and surfaces | |
139| --- | --- |
140| [Codex web](https://developers.openai.com/codex/cloud) | — |
141| [Codex app for local tasks](https://developers.openai.com/codex/app) | |
142| [Codex CLI](https://developers.openai.com/codex/cli) | |
143| [IDE extension](https://developers.openai.com/codex/ide) | |
144| [Codex SDK, `codex exec`, and scriptable workflows](https://developers.openai.com/codex/sdk) | |
145| Models and multimodal | |
146| [Bedrock-backed inference with supported OpenAI models](https://developers.openai.com/codex/amazon-bedrock) | |
147| [Fast mode](https://developers.openai.com/codex/speed) | — |
148| [Image generation and editing](https://developers.openai.com/codex/app/features#image-generation) | — |
149| [Voice dictation](https://developers.openai.com/codex/app/features#voice-dictation) | — |
150| [Web search](https://developers.openai.com/codex/app/features#web-search) | — |
151| Local features | |
152| [Local code review with `/review`](https://developers.openai.com/codex/workflows#do-a-local-code-review) | |
153| [Auto-review for approval requests](https://developers.openai.com/codex/concepts/sandboxing/auto-review) | |
154| [Sandboxing and permission controls](https://developers.openai.com/codex/permissions) | |
155| [Project and standalone app automations](https://developers.openai.com/codex/app/automations) | |
156| [Automations](https://developers.openai.com/codex/app/automations) | |
157| [Worktrees and built-in Git tools](https://developers.openai.com/codex/app/worktrees) | |
158| [Local environments and repeatable actions](https://developers.openai.com/codex/app/local-environments) | |
159| [Appshots](https://developers.openai.com/codex/appshots) | |
160| Browser and remote control | |
161| [In-app browser previews and comments](https://developers.openai.com/codex/app/browser) | |
162| [Browser Use automation](https://developers.openai.com/codex/app/browser#browser-use) | [Limited\*](#codex-plan-region-limits "Available with regional limits") |
163| [Chrome extension browser control](https://developers.openai.com/codex/app/chrome-extension) | [Limited\*](#codex-plan-region-limits "Available with regional limits") |
164| [Computer Use](https://developers.openai.com/codex/app/computer-use) | [Limited\*](#codex-plan-region-limits "Available with regional limits") |
165| [SSH remote connections](https://developers.openai.com/codex/remote-connections#connect-to-an-ssh-host) | |
166| [Mobile remote control](https://developers.openai.com/codex/remote-connections) | — |
167| Customization and extensions | |
168| [Custom instructions with `AGENTS.md`](https://developers.openai.com/codex/guides/agents-md) | |
169| [Skills](https://developers.openai.com/codex/skills) | |
170| [Plugins](https://developers.openai.com/codex/plugins) | [Limited†](#codex-plan-plugin-limits "Available with plugin limits") |
171| [Plugin sharing](https://developers.openai.com/codex/plugins/build#share-a-local-plugin-with-your-workspace) | — |
172| [App connectors](https://developers.openai.com/codex/plugins) | — |
173| [MCP](https://developers.openai.com/codex/mcp) | |
174| [Subagents and custom agents](https://developers.openai.com/codex/subagents) | |
175| [Memories](https://developers.openai.com/codex/memories) | [Limited\*](#codex-plan-region-limits "Available with regional limits") |
176| [Chronicle](https://developers.openai.com/codex/memories/chronicle) | — |
177| Cloud and integrations | |
178| [Codex cloud tasks](https://developers.openai.com/codex/cloud) | — |
179| [Sites](https://developers.openai.com/codex/sites) | — |
180| [GitHub issue and PR delegation with `@codex`](https://developers.openai.com/codex/integrations/github#give-codex-other-tasks) | — |
181| [GitHub code review and automatic PR reviews](https://developers.openai.com/codex/integrations/github) | — |
182| [Slack cloud integration](https://developers.openai.com/codex/integrations/slack) | — |
183| [Linear cloud integration](https://developers.openai.com/codex/integrations/linear) | — |
184| Admin, security, and analytics | |
185| [SAML SSO, MFA, and workspace user management](https://developers.openai.com/codex/enterprise/admin-setup) | — |
186| [`requirements.toml` managed config](https://developers.openai.com/codex/enterprise/managed-configuration) | |
187| [Cloud-managed config policies](https://developers.openai.com/codex/enterprise/managed-configuration#cloud-managed-requirements) | — |
188| [Codex RBAC and custom roles](https://developers.openai.com/codex/enterprise/admin-setup#step-2-set-up-custom-roles-rbac) | — |
189| [SCIM, EKM, and domain verification](https://developers.openai.com/codex/enterprise/admin-setup#enterprise-grade-security-and-privacy) | — |
190| [Enterprise retention and residency controls](https://developers.openai.com/codex/enterprise/admin-setup#enterprise-grade-security-and-privacy) | — |
191| [No training on API or business data by default](https://openai.com/business-data/) | |
192| [Analytics dashboard](https://developers.openai.com/codex/enterprise/governance#analytics-dashboard) | — |
193| [Analytics API](https://developers.openai.com/codex/enterprise/governance#analytics-api) | — |
194| [Compliance API and audit logs](https://developers.openai.com/codex/enterprise/governance#compliance-api) | — |
195| [Codex Security for connected GitHub repositories](https://developers.openai.com/codex/security) | — |
196
197\* Feature is currently limited to only specific regions. Check
198the individual feature documentation to learn more about geo restrictions.
199
200† Some first party plugins are not available.
201
202## Troubleshooting
203
204If setup fails, check the following:
205
206- The model ID exactly matches a supported model.
207- You specify an AWS Region where the model is available.
208- The Bedrock API key or AWS credentials are valid and not expired.
209- The AWS identity has permission to access the selected Bedrock model.
210- `AWS_BEARER_TOKEN_BEDROCK` isn’t set to an expired or unintended key.
211- For desktop app or VS Code extension usage, required environment variables
212 are present in `~/.codex/.env`.
213
214## Support boundaries
215
216OpenAI Support can help with Codex client setup, configuration, local CLI
217behavior, desktop app behavior, IDE extension behavior, and the local Codex
218product experience.
219
220For AWS credentials, IAM permissions, Bedrock model access, quotas, billing,
221regional availability, Bedrock request failures, AWS service logs, or Bedrock
222service behavior, contact the customer’s AWS administrator or AWS Support.
223