OpenAI Models on AWS: Amazon Bedrock and Codex Explained

Updated
8 min read
OpenAI on AWS diagram connecting an application and a terminal to one cloud.
TL;DR

Choose the right AWS path for an application that calls an OpenAI model or a team that wants Codex backed by Amazon Bedrock.

OpenAI models on AWS give you two common starting points. If users of your application need model responses, call an OpenAI model through Amazon Bedrock. If your engineers want Codex in their editor or terminal, configure Codex to use Bedrock as its model provider. The distinction matters because the two teams have different things to test and different access to maintain.

The general availability announcement dates to June 1, 2026. For a rollout today, start with the current AWS model cards and the features your team actually uses. The launch announcement is useful for history and product scope.

Choose the AWS path by what you are building

You needStart hereCheck before rollout
An application that sends prompts to an OpenAI modelAn Amazon Bedrock inference endpointModel ID, supported API, Region and quota
Codex for developers working in local repositoriesCodex with the Amazon Bedrock providerClient support, developer identity and feature availability
A managed agent that runs a service workflowEvaluate Bedrock Managed Agents separatelyService availability, runtime identity, state and execution controls

For a pilot, write down which row covers the job. An AWS success in one row tells you little about the parts you have yet to test in another. For example, a successful Responses API call confirms that the credentials can run model inference. It gives you no evidence about the Codex client’s file access or its support for a tool your developers use.

Run one Bedrock inference request first

The OpenAI model cards in Amazon Bedrock currently list models including GPT-6.2 Astra and GPT-6.2 Sol. Open the card and copy the model ID for your endpoint. Then check the Bedrock model and Region table for where you can call it and what routing options apply.

For an existing application using the OpenAI SDK, compare the Bedrock inference endpoints before setting the base URL. AWS documents OpenAI-compatible access on Bedrock. The name of the environment variable can catch people out: in the Bedrock Responses API example, the SDK's OPENAI_API_KEY variable holds a Bedrock API key. Use the credential method approved for your deployment and verify the permissions it needs.

Test one ordinary application request with synthetic data. Record the model ID, endpoint and Region, whether streaming or tools behave as expected, and latency at the request sizes your team actually sends. Check where the usage and cost appear in AWS. Our guide to running AI agents in production covers what to measure as the pilot moves beyond that first call.

Roll out Codex with one repository and one team

In this setup the Codex client runs locally and sends model requests to Amazon Bedrock. OpenAI’s Codex and Bedrock feature guide lists restrictions for features that depend on OpenAI-hosted services. Review them alongside your team’s actual workflow. A developer using a local client and repo commands may need a different rollout from a team relying on hosted jobs or cloud-managed tools.

The AWS Codex rollout guide covers identity approaches. Pick one with your AWS administrators and try a small, reviewable change in a non-sensitive repo. Start with the setup in our Codex harness checklist and give the agent the repo commands it needs through your AGENTS.md instructions.

Write an inference test that tells you where the failure is

Start with a request the application already knows how to grade. Say you want an internal ticket summarizer to turn a short synthetic ticket into a one-sentence summary and two action items. Keep the ticket and expected shape fixed while trying the new endpoint. Begin with one model and one Region. That way, a model access error, a request-format error, and a weak summary are distinct problems you can work on separately.

Have a developer run a small request from the same kind of environment where the application runs. A laptop test can confirm the endpoint and model ID, but it may use a different identity and network route from a deployed service. Run the next check using the intended staging identity. Record the endpoint, Region, model ID, authentication method, and expected response fields. Save the identifiers and status codes you need for debugging while keeping credentials and request bodies out of routine logs.

Keep the first test readable even when the application streams its output. For an application that expects a structured result, check that the final value still meets your schema. If your current application expects a built-in tool, test that tool separately. An endpoint may accept a basic request and still behave differently on the feature the application depends on. Use the Bedrock API compatibility table alongside the model card when choosing which combinations to test.

Click any column to sort
4 rows
The endpoint refuses the requestIs the staging identity authorized for this endpoint, model, and Region?
The request is accepted but fails validationDoes this endpoint and model support the request fields you sent?
The response completes but the application rejects itDoes the response meet the application’s validation and streaming expectations?
The response is useful but slow for a normal requestWhich parts of latency are visible in the app, and what is the effect on the user?

Make the model and Region choices visible to operators

Leave the choices in configuration where your team can inspect them. When somebody opens an incident report, they should be able to tell which model and endpoint were in use without reading app code or reconstructing a deploy. Include the selection in the service documentation and record the deployment version alongside your normal metrics.

Check the Region table for the exact routing option you intend to use. A service team may care about where a request is processed as well as where it is sent. Give the person responsible for data placement the model card and routing choice to review. Keep the settings for testing and production distinct so that a developer can see which one they are working with. The existence of a model in a provider catalog is just the first fact in this decision.

Have a plan for an API failure, too. If the summarizer cannot complete, the user can still read the original ticket. For an agent that performs a write, the behavior is more involved because a failed request can leave its outcome unknown. Our AI agent failure recovery guide shows how to record that state and recover a result safely. Choose the behavior needed by the application before rolling it out to more people.

Evaluate Codex with the same team workflow

On the developer side, ask two developers to run the same small repository task under their own approved accounts. Give them a failing test or a documentation change they can both verify. The pilot should tell you whether developers can configure the client, get a usable result, and know where to go when the provider denies a request. If setup only works on the laptop of the person who wrote the instructions, it is too early to roll it out broadly.

Ask each engineer to record the client they used, the model they selected, and which functions of their normal workflow were available. For example, somebody who works entirely in an editor may care about a different set of features from a developer who uses hosted jobs. List features by the exact workflow they enable. “Open a local checkout and fix a test” is easier to verify than a blanket assertion that the client behaves identically.

Also decide who owns the provider configuration. Individual engineers can still control their normal repository work, while administrators manage credentials and access paths. Store a short setup and recovery note alongside the team's other development tools. Include where to check quota or authentication failures and what information to give the owner. Add a real test case to the note instead of a generic “try a prompt.”

Compare the cost of the work you actually accept

For application inference, record failure rates, latency, and usage for a small set of representative requests. Keep task difficulty and request size in the data. A short sample ticket can make a configuration look fast and economical while saying little about a bigger input with tools or streaming enabled.

For the Codex pilot, compare reviewable changes. Record the developer time to set up a task, the time spent reviewing the output, and any rework needed before approval. Our cost per accepted fix guide gives a concrete way to think about this cost. Use charges and measurements from your own account and reporting window.

At the end of the pilot, keep a short record of what worked, what still needs a check, and how to restore the prior configuration. Include a named owner for the service or repository. When a new model becomes available, that record gives you something to repeat instead of starting the rollout decision from scratch.

Before adding another repository, have a developer repeat the task using their own authorized identity and confirm that the expected AWS account records the inference. That is a useful first proof that the setup works for the people who will maintain it.

Frequently Asked Questions

Can I use OpenAI models on AWS?

Yes. Amazon Bedrock lists supported OpenAI models and their available Regions and APIs. Check the card for the exact model before configuring the application.

Do I need an OpenAI API key for Bedrock inference?

The Bedrock endpoint uses AWS authentication. Where AWS’s OpenAI SDK example sets OPENAI_API_KEY, that variable holds an Amazon Bedrock API key.

Does Codex move my local checkout to AWS?

In the Bedrock-provider configuration documented by OpenAI, the Codex client runs locally and sends model requests to Bedrock. Check the current documentation for features that require OpenAI-hosted services.

#openai#aws#amazon-bedrock#codex#cloud-inference

One AI engineering post, weekly

LLM benchmarks, prompt techniques, and token-cost breakdowns, delivered to your inbox.

What should we test or explain next?

Comments

Have a question or something to add? Sign in to join the discussion.

Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

Software architect, full-stack engineer, and machine learning practitioner. Founder & CEO of Pristren, CTO at Venture Kick-backed PIN Sport Application GmbH (Basel, Switzerland), Software Development Lead at DailyFrame GmbH (building Dimetra patient transport software), and creator of Zlyqor. Focused on custom workflow automation, scalable web and mobile applications, and production AI/ML systems.