Use ChatGPT Work and Codex with Amazon Bedrock
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending
.mdto the page URL.
Configure local ChatGPT Work and Codex surfaces to use OpenAI models available through Amazon Bedrock. In this setup, the local client sends model requests to Bedrock using AWS-managed authentication and access controls.
This page covers direct access to Bedrock. If your organization already provides a model gateway, follow Connect to a gateway. To configure a gateway backed by Bedrock, see Bedrock through LiteLLM.
How it works
When you configure a local ChatGPT Work or Codex surface with Amazon Bedrock as the model provider, the OpenAI-hosted Responses API isn't in the request path. The local client sends model requests to Amazon Bedrock, and Bedrock provides an OpenAI-compatible Responses API implementation for supported OpenAI models.
Authentication is AWS-native. Users authenticate with a Bedrock API key or AWS
IAM credentials. They do not use ChatGPT sign-in or OPENAI_API_KEY for this
provider.
Before you start
Make sure you have:
- Credentials for the AWS account you want to use.
- Access to supported OpenAI models in Amazon Bedrock.
- Access to an AWS Region where the selected model is available.
- AWS permission to invoke the selected model or inference profile.
Check the model-specific IAM requirements. For example, GPT-6 Sol through Runtime
also requires bedrock:InvokeModel on the account's default project. See AWS's GPT-6 Sol setup instructions.
Configure the provider
Codex allows you to configure the provider by setting model_provider in ~/.codex/config.toml. The ChatGPT desktop app, Codex CLI, IDE extension, and SDK read the same local configuration layers.
Choose the provider for the Amazon Bedrock endpoint you want to use: Bedrock Runtime for cross-Region inference (CRIS), or Bedrock Mantle for in-Region inference.
Use Bedrock Runtime for new configurations:
model_provider = "amazon-bedrock-runtime"
web_search = "disabled"
Hosted web search isn't available on Bedrock Runtime. If you need it, use
Bedrock Mantle. The amazon-bedrock
provider selects Mantle; amazon-bedrock-runtime selects Runtime.
Use Mantle for hosted web search
For the Bedrock Mantle endpoint:
model_provider = "amazon-bedrock"
web_search = "cached"
Choose a model
Codex uses the configured model_provider to choose which models appear in the
model picker: models supported through the Bedrock Runtime endpoint for
amazon-bedrock-runtime, or through the Bedrock Mantle endpoint for
amazon-bedrock.
You can optionally specify a supported model in the configuration file. The built-in provider supplies its own model catalog. When switching endpoints, change the provider and any explicit model ID together.
Model availability varies by AWS Region. Refer to AWS Regional availability by models.
Authentication options
Local ChatGPT Work and Codex surfaces support two Bedrock authentication paths. They check them in this order:
- Bedrock API key.
- AWS SDK credential chain.
Option 1: Bedrock API key
Set the Bedrock API key in the environment the local client reads. You must specify a Region when using API-key authentication.
export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
export AWS_REGION=us-east-2
On Windows PowerShell:
$env:AWS_BEARER_TOKEN_BEDROCK = "<your-bedrock-api-key>"
$env:AWS_REGION = "us-east-2"
Option 2: AWS SDK credentials
Use this path when your organization manages Bedrock access through the AWS SDK credential chain. The local client can use these standard AWS SDK credential sources:
Shared AWS configuration files
Configure the shared AWS config and credentials files:
aws configure
Environment variables
Set the standard AWS SDK credential environment variables:
export AWS_ACCESS_KEY_ID=<your-access-key-id>
export AWS_SECRET_ACCESS_KEY=<your-secret-access-key>
export AWS_SESSION_TOKEN=<your-session-token>
AWS Management Console credentials
Log in with AWS Management Console credentials:
aws login
AWS SSO or a named profile
Log in with AWS SSO and select the named profile:
aws sso login --profile codex-bedrock
export AWS_PROFILE=codex-bedrock
Federated identity
For corporate SSO or OIDC federation, configure a federated identity with
credential_process outside the local client and let the AWS SDK resolve
credentials. Put browser login, token exchange, caching, and refresh in your
AWS profile's credential_process helper.
Desktop app and IDE extension
Desktop apps and IDE extensions may not inherit environment variables from the
shell. Put required values in ~/.codex/.env, then restart the app or
extension. On Windows, the default path is %USERPROFILE%\.codex\.env.
export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
export AWS_REGION=us-east-2
Verify setup
- In Codex CLI, open
/statusand confirm the model provider matches your endpoint:amazon-bedrockfor Mantle in-Region inference, oramazon-bedrock-runtimefor Runtime Global or Geo cross-Region inference. - In the ChatGPT desktop app, select Work or Codex and start a new task after restarting the app.
- In the IDE extension, start a new session after restarting the extension.
- Confirm the selected model is available in the configured AWS Region and that the AWS identity has permission to access it.
Then send a short prompt in a new task:
Reply with exactly: bedrock-ok
Expect bedrock-ok. Confirm the provider and model in the client; the reply alone
doesn't identify the route. For rollout qualification, use a disposable folder
with read-only permissions and verify a harmless local tool task and a follow-up
turn.
Supported models
Use an inference profile ID for Bedrock Runtime provider or a model ID for Bedrock Mantle provider. The selected model or profile must be available in your AWS Region and accessible to your AWS identity.
Global and Geo cross-Region inference using the Bedrock Runtime endpoint
Global CRIS can route requests to supported commercial AWS Regions worldwide, whereas Geo CRIS routes requests within the profile's geography. Choose a routing scope that meets your AWS permissions and data-residency requirements.
Use model_provider = "amazon-bedrock-runtime" with the optional model configuration set to an inference profile ID from the following lists. The provider uses
https://bedrock-runtime.{region}.amazonaws.com/openai/v1, where {region} is
the supported source AWS Region from which you send requests. Both Global and Geo CRIS use this endpoint address.
Global CRIS
Supported models and inference profile IDs:
- GPT-6 Astra:
global.openai.gpt-6-astra - GPT-6 Sol:
global.openai.gpt-6-sol - GPT-6 Luna:
global.openai.gpt-6-luna
For example, configure Astra with Global CRIS in ~/.codex/config.toml:
model_provider = "amazon-bedrock-runtime"
model = "global.openai.gpt-6-astra"
United States Geo CRIS
Supported models and inference profile IDs:
- GPT-6 Astra:
us.openai.gpt-6-astra - GPT-6 Sol:
us.openai.gpt-6-sol - GPT-6 Luna:
us.openai.gpt-6-luna
Codex's built-in Runtime model picker lists the United States Geo and Global variants.
Model and CRIS availability vary by source AWS Region. See AWS Supported Regions and models for inference profiles, which links to each model's exact inference profile IDs and regional availability, and AWS Regional availability by models before selecting a provider and a model.
In-Region inference using the Bedrock Mantle endpoint
Use model_provider = "amazon-bedrock" with an optional model ID. The provider uses
https://bedrock-mantle.{region}.api.aws/openai/v1.
Supported models and model IDs:
- GPT-6 Astra:
openai.gpt-6-astra - GPT-6 Sol:
openai.gpt-6-sol - GPT-6 Luna:
openai.gpt-6-luna
GPT-6 Sol and Luna are available through Mantle in us-east-1 (N. Virginia).
Model availability varies by AWS Region. See AWS Regional availability by models before selecting a provider and a model. For GPT-6 Astra, refer to the Bedrock model page for GPT-6 Astra.
Feature availability
This configuration supports local ChatGPT Work and Codex workflows. Hosted ChatGPT Work on the web, Codex cloud, and features that depend on OpenAI-hosted cloud services or cloud-managed discovery aren't currently available. Hosted web search is unavailable on Runtime; use Mantle if you need it.
Codex Security CLI uses its own provider configuration. Follow its Amazon Bedrock setup rather than the native client settings above.
Fast Mode isn't available with Amazon Bedrock. Fast Mode uses priority processing, and the initial Amazon Bedrock offering supports on-demand inference only.
Troubleshooting
If setup fails, check the following:
- The model ID exactly matches a supported model.
- You use the correct model provider for the endpoint:
amazon-bedrock-runtimefor Runtime endpoint oramazon-bedrockfor Mantle endpoint. - You specify an AWS Region where the model is available.
- The Bedrock API key or AWS credentials are valid and not expired.
- The AWS identity has permission to access the selected Bedrock model.
AWS_BEARER_TOKEN_BEDROCKisn't set to an expired or unintended key.- For desktop app or IDE extension usage, required environment variables are
present in
~/.codex/.env.
For AWS SDK profile authentication, run aws sts get-caller-identity --profile codex-bedrock
to confirm the identity for your selected profile. Replace codex-bedrock with
your profile name, or omit --profile when using the default credential chain.
This checks AWS identity, not permission to invoke a Bedrock model. Check
AWS_BEARER_TOKEN_BEDROCK separately so an unintended API key doesn't select a
different authentication path.
Support boundaries
OpenAI Support can help with ChatGPT Work and Codex client setup, configuration, local CLI behavior, desktop app behavior, IDE extension behavior, and the local product experience.
For AWS credentials, IAM permissions, Bedrock model access, quotas, billing, regional availability, Bedrock request failures, AWS service logs, or Bedrock service behavior, contact the customer's AWS administrator or AWS Support.
amazon-bedrock.md +60 −22
6through Amazon Bedrock. In this setup, the local client sends model requests to6through Amazon Bedrock. In this setup, the local client sends model requests to
7Bedrock using AWS-managed authentication and access controls.7Bedrock using AWS-managed authentication and access controls.
8 8
9This page covers direct access to Bedrock. If your organization already
10 provides a model gateway, follow [Connect to a
11 gateway](https://learn.chatgpt.com/docs/enterprise/connect-to-a-gateway). To configure a gateway
12 backed by Bedrock, see [Bedrock through
13 LiteLLM](https://learn.chatgpt.com/docs/enterprise/bedrock-through-litellm).
14
9## How it works15## How it works
10 16
11When you configure a local ChatGPT Work or Codex surface with Amazon Bedrock as17When you configure a local ChatGPT Work or Codex surface with Amazon Bedrock as
21 27
22Make sure you have:28Make sure you have:
23 29
2430- Credentials for the AWS account you want to use- Credentials for the AWS account you want to use.
25- Access to supported OpenAI models in Amazon Bedrock.31- Access to supported OpenAI models in Amazon Bedrock.
26- Access to an AWS Region where the selected model is available.32- Access to an AWS Region where the selected model is available.
33- AWS permission to invoke the selected model or inference profile.
34
35Check the model-specific IAM requirements. For example, GPT-6 Sol through Runtime
36also requires `bedrock:InvokeModel` on the account's default project. See AWS's [GPT-6 Sol setup instructions](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-sol.html).
27 37
28## Configure the provider38## Configure the provider
29 39
32Choose the provider for the Amazon Bedrock endpoint you want to use: Bedrock42Choose the provider for the Amazon Bedrock endpoint you want to use: Bedrock
33Runtime for cross-Region inference (CRIS), or Bedrock Mantle for in-Region inference.43Runtime for cross-Region inference (CRIS), or Bedrock Mantle for in-Region inference.
34 44
3545For the Bedrock Runtime endpoint:Use Bedrock Runtime for new configurations:
36 46
37```toml47```toml
38model_provider = "amazon-bedrock-runtime"48model_provider = "amazon-bedrock-runtime"
49web_search = "disabled"
39```50```
40 51
52Hosted web search isn't available on Bedrock Runtime. If you need it, use
53 [Bedrock Mantle](#use-mantle-for-hosted-web-search). The `amazon-bedrock`
54 provider selects Mantle; `amazon-bedrock-runtime` selects Runtime.
55
56### Use Mantle for hosted web search
57
41For the Bedrock Mantle endpoint:58For the Bedrock Mantle endpoint:
42 59
43```toml60```toml
44model_provider = "amazon-bedrock"61model_provider = "amazon-bedrock"
62web_search = "cached"
45```63```
46 64
47### Choose a model65### Choose a model
52`amazon-bedrock`.70`amazon-bedrock`.
53 71
54You can optionally specify a [supported model](#supported-models) in the72You can optionally specify a [supported model](#supported-models) in the
5573configuration file.configuration file. The built-in provider supplies its own model catalog.
74When switching endpoints, change the provider and any explicit model ID together.
56 75
5776Model availability varies by AWS Region. Refer to AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai). Local ChatGPT Work and Codex surfaces don't support Bedrock Mantle endpoints in AWS GovCloud Regions.Model availability varies by AWS Region. Refer to AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai).
58 77
59## Authentication options78## Authentication options
60 79
74export AWS_REGION=us-east-293export AWS_REGION=us-east-2
75```94```
76 95
96On Windows PowerShell:
97
98```powershell
99$env:AWS_BEARER_TOKEN_BEDROCK = "<your-bedrock-api-key>"
100$env:AWS_REGION = "us-east-2"
101```
102
77### Option 2: AWS SDK credentials103### Option 2: AWS SDK credentials
78 104
79Use this path when your organization manages Bedrock access through the AWS SDK105Use this path when your organization manages Bedrock access through the AWS SDK
126 152
127Desktop apps and IDE extensions may not inherit environment variables from the153Desktop apps and IDE extensions may not inherit environment variables from the
128shell. Put required values in `~/.codex/.env`, then restart the app or154shell. Put required values in `~/.codex/.env`, then restart the app or
129155extension.extension. On Windows, the default path is `%USERPROFILE%\.codex\.env`.
130 156
131```shell157```shell
132export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>158export AWS_BEARER_TOKEN_BEDROCK=<your-bedrock-api-key>
144- Confirm the selected model is available in the configured AWS Region and that170- Confirm the selected model is available in the configured AWS Region and that
145 the AWS identity has permission to access it.171 the AWS identity has permission to access it.
146 172
173Then send a short prompt in a new task:
174
175```text
176Reply with exactly: bedrock-ok
177```
178
179Expect `bedrock-ok`. Confirm the provider and model in the client; the reply alone
180doesn't identify the route. For rollout qualification, use a disposable folder
181with read-only permissions and verify a harmless local tool task and a follow-up
182turn.
183
147## Supported models184## Supported models
148 185
149Use an inference profile ID for Bedrock Runtime provider or a model ID for Bedrock Mantle provider.186Use an inference profile ID for Bedrock Runtime provider or a model ID for Bedrock Mantle provider.
154 191
155Global CRIS can route requests to supported192Global CRIS can route requests to supported
156commercial AWS Regions worldwide, whereas Geo CRIS routes requests within the profile's geography.193commercial AWS Regions worldwide, whereas Geo CRIS routes requests within the profile's geography.
194Choose a routing scope that meets your AWS permissions and data-residency requirements.
157 195
158Use `model_provider = "amazon-bedrock-runtime"` with the optional `model` configuration set to an inference profile ID from the following lists. The provider uses196Use `model_provider = "amazon-bedrock-runtime"` with the optional `model` configuration set to an inference profile ID from the following lists. The provider uses
159`https://bedrock-runtime.{region}.amazonaws.com/openai/v1`, where `{region}` is197`https://bedrock-runtime.{region}.amazonaws.com/openai/v1`, where `{region}` is
166- GPT-6 Astra: `global.openai.gpt-6-astra`204- GPT-6 Astra: `global.openai.gpt-6-astra`
167- GPT-6 Sol: `global.openai.gpt-6-sol`205- GPT-6 Sol: `global.openai.gpt-6-sol`
168- GPT-6 Luna: `global.openai.gpt-6-luna`206- GPT-6 Luna: `global.openai.gpt-6-luna`
169- GPT-5.6 Sol: `global.openai.gpt-5.6-sol`
170- GPT-5.6 Terra: `global.openai.gpt-5.6-terra`
171- GPT-5.6 Luna: `global.openai.gpt-5.6-luna`
172 207
173For example, configure Astra with Global CRIS in `~/.codex/config.toml`:208For example, configure Astra with Global CRIS in `~/.codex/config.toml`:
174 209
184- GPT-6 Astra: `us.openai.gpt-6-astra`219- GPT-6 Astra: `us.openai.gpt-6-astra`
185- GPT-6 Sol: `us.openai.gpt-6-sol`220- GPT-6 Sol: `us.openai.gpt-6-sol`
186- GPT-6 Luna: `us.openai.gpt-6-luna`221- GPT-6 Luna: `us.openai.gpt-6-luna`
187- GPT-5.6 Sol: `us.openai.gpt-5.6-sol`
188- GPT-5.6 Terra: `us.openai.gpt-5.6-terra`
189- GPT-5.6 Luna: `us.openai.gpt-5.6-luna`
190 222
191Codex's built-in Runtime model picker lists the United States Geo and Global223Codex's built-in Runtime model picker lists the United States Geo and Global
192224variants. AWS also lists India geographic inference profile IDs `in.openai.gpt-5.6-terra` andvariants.
193`in.openai.gpt-5.6-luna` for `ap-south-1` (Mumbai) and `ap-south-2` (Hyderabad). Refer to Bedrock model cards for [GPT-5.6 Terra](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-terra.html) and [GPT-5.6 Luna](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-56-luna.html) for details.
194 225
195Model and CRIS availability vary by source AWS Region. See AWS [Supported Regions and models for inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html), which links to each model's exact inference profile IDs and regional226Model and CRIS availability vary by source AWS Region. See AWS [Supported Regions and models for inference profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html), which links to each model's exact inference profile IDs and regional
196availability, and AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai) before selecting a provider and a model.227availability, and AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai) before selecting a provider and a model.
205- GPT-6 Astra: `openai.gpt-6-astra`236- GPT-6 Astra: `openai.gpt-6-astra`
206- GPT-6 Sol: `openai.gpt-6-sol`237- GPT-6 Sol: `openai.gpt-6-sol`
207- GPT-6 Luna: `openai.gpt-6-luna`238- GPT-6 Luna: `openai.gpt-6-luna`
208- GPT-5.6 Sol: `openai.gpt-5.6-sol`
209- GPT-5.6 Terra: `openai.gpt-5.6-terra`
210- GPT-5.6 Luna: `openai.gpt-5.6-luna`
211- GPT-5.5: `openai.gpt-5.5`
212- GPT-5.4: `openai.gpt-5.4`
213 239
214GPT-6 Sol and Luna are available through Mantle in `us-east-1` (N. Virginia).240GPT-6 Sol and Luna are available through Mantle in `us-east-1` (N. Virginia).
215Model availability varies by AWS Region. See AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai) before selecting a provider and a model. For GPT-6 Astra, refer to the [Bedrock model page for GPT-6 Astra](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-astra.html).241Model availability varies by AWS Region. See AWS [Regional availability by models](https://docs.aws.amazon.com/bedrock/latest/userguide/models-region-compatibility.html#model-regions-openai) before selecting a provider and a model. For GPT-6 Astra, refer to the [Bedrock model page for GPT-6 Astra](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-openai-gpt-6-astra.html).
218 244
219This configuration supports local ChatGPT Work and Codex workflows. Hosted245This configuration supports local ChatGPT Work and Codex workflows. Hosted
220ChatGPT Work on the web, Codex cloud, and features that depend on OpenAI-hosted246ChatGPT Work on the web, Codex cloud, and features that depend on OpenAI-hosted
221247cloud services, hosted tools, or cloud-managed discovery aren't currentlycloud services or cloud-managed discovery aren't currently
222248available.available. Hosted web search is unavailable on Runtime; use
249[Mantle](#use-mantle-for-hosted-web-search) if you need it.
250
251Codex Security CLI uses its own provider configuration. Follow its
252[Amazon Bedrock setup](https://learn.chatgpt.com/docs/security/cli/reference) rather than the native
253client settings above.
223 254
224Fast Mode isn't available with Amazon Bedrock. Fast Mode uses priority255Fast Mode isn't available with Amazon Bedrock. Fast Mode uses priority
225 processing, and the initial Amazon Bedrock offering supports on-demand256 processing, and the initial Amazon Bedrock offering supports on-demand
326 },357 },
327 },358 },
328 {359 {
329360 name: "Web search", name: "Hosted web search on Runtime",
330 href: "/codex/web-search?surface=app",361 href: "/codex/web-search?surface=app",
331 availability: {362 availability: {
332 bedrock: "unavailable",363 bedrock: "unavailable",
680 className="not-prose mt-3 text-sm text-secondary"711 className="not-prose mt-3 text-sm text-secondary"
681 >712 >
682 <sup>*</sup> Feature is currently limited to only specific regions. Check713 <sup>*</sup> Feature is currently limited to only specific regions. Check
683714 the individual feature documentation to learn more about geo restrictions. the individual feature documentation to learn more about regional restrictions.
684 715
685 716
686 <div717 <div
708- For desktop app or IDE extension usage, required environment variables are739- For desktop app or IDE extension usage, required environment variables are
709 present in `~/.codex/.env`.740 present in `~/.codex/.env`.
710 741
742For AWS SDK profile authentication, run `aws sts get-caller-identity --profile codex-bedrock`
743to confirm the identity for your selected profile. Replace `codex-bedrock` with
744your profile name, or omit `--profile` when using the default credential chain.
745This checks AWS identity, not permission to invoke a Bedrock model. Check
746`AWS_BEARER_TOKEN_BEDROCK` separately so an unintended API key doesn't select a
747different authentication path.
748
711## Support boundaries749## Support boundaries
712 750
713OpenAI Support can help with ChatGPT Work and Codex client setup,751OpenAI Support can help with ChatGPT Work and Codex client setup,