Built-in amazon-bedrock provider uses outdated Mantle endpoint path (/openai/v1/responses)
Resolved 💬 8 comments Opened May 20, 2026 by ryu1 Closed Jul 6, 2026
What issue are you seeing?
Summary
Codex CLI v0.132.0 appears to use an outdated AWS Bedrock Mantle endpoint path when using the built-in amazon-bedrock provider.
The built-in provider sends requests to:
/openai/v1/responses
However, current AWS Bedrock Mantle documentation specifies:
/v1/responses
This causes requests to fail with 404.
---
Environment
- Codex CLI: v0.132.0
- AWS Region:
ap-northeast-1 - Model:
openai.gpt-oss-120b
---
Current config
profile = "bedrock-profile"
[model_providers.amazon-bedrock]
model_provider = "amazon-bedrock"
[profiles.bedrock-profile]
model_provider = "amazon-bedrock"
model = "openai.gpt-oss-120b"
---
Actual request URL
Codex sends requests to:
https://bedrock-mantle.ap-northeast-1.api.aws/openai/v1/responses
This returns:
404 Not Found
---
Verification performed
Using a custom OpenAI provider configuration, I verified that:
https://bedrock-mantle.ap-northeast-1.api.aws/v1/responses
exists and responds correctly.
Example result:
401 Unauthorized: Invalid bearer token
This confirms that:
/v1/responsesexists- Bedrock Mantle Responses API is available
openai.gpt-oss-120bsupports Responses API- the built-in provider appears to construct the wrong URL path
---
What steps can reproduce the bug?
Built-in amazon-bedrock provider should use:
/v1/responses
instead of:
/openai/v1/responses
What is the expected behavior?
_No response_
Additional information
_No response_
8 Comments
I have a small fix branch ready here if it helps maintainers cherry-pick it:
https://github.com/kiwigitops/codex/tree/fix-bedrock-mantle-base-url
It changes the built-in Bedrock Mantle endpoint path from
/openai/v1to/v1in both places that construct the provider URL:codex-rs/model-provider-info/src/lib.rscodex-rs/model-provider/src/amazon_bedrock/mantle.rsIt also updates the existing assertions in:
codex-rs/model-provider-info/src/model_provider_info_tests.rscodex-rs/model-provider/src/amazon_bedrock/mantle.rscodex-rs/model-provider/src/amazon_bedrock/mod.rscodex-rs/tui/src/status/tests.rsI tried opening this as a PR, but GitHub returned a
CreatePullRequestpermissions error for this repository. Verification I could run locally:git diff --checkrg -n bedrock-mantle.*openai/v1 codex-rs -g *.rsreturns no remaining Rust matchesI could not run the Rust test locally because this Windows environment does not have
cargoon PATH.I've independently verified this bug across all 6 Mantle-supported regions (2026-05-29, with AWS account):
| Region |
/v1/responses|/openai/v1/responses|| --- | --- | --- |
| us-east-1 | ✅ HTTP 200 | ❌ HTTP 400 |
| us-east-2 | ✅ HTTP 200 | ❌ HTTP 400 |
| us-west-2 | ✅ HTTP 200 | ❌ HTTP 400 |
| ap-northeast-1 | ✅ HTTP 200 | ❌ HTTP 400 |
| eu-west-1 | ✅ HTTP 200 | ❌ HTTP 400 |
| ap-southeast-1 | ⏱️ timeout (inference latency) | ❌ HTTP 400 |
The 400 response body is always:
Regarding the comment in #21352 that
/openai/v1is "intentional for post-GA" — note that Bedrock Mantle (bedrock-mantle.<region>.api.aws) and Bedrock Runtime OpenAI-compat (bedrock-runtime.<region>.amazonaws.com) are two entirely different services with different SigV4 service names:bedrock-mantle, path/v1/*, supports Responses APIbedrock, path/openai/v1/*, Chat Completions onlyThe
/openai/v1prefix belongs to Bedrock Runtime, not Mantle. PR #20109 conflated the two. AWS official docs (Generate responses using OpenAI APIs) have never listed/openai/v1as a Mantle endpoint.Fix branch with full unit tests + regression test: https://github.com/kingdoooo/codex/tree/worktree-fix-bedrock-mantle-path (commit
60a68f911)The fix is a one-line change per file —
"/openai/v1"→"/v1"inmantle.rsandmodel-provider-info/src/lib.rs, plus a new regression testbase_url_must_not_use_openai_v1_prefixto prevent this from recurring.Binary patch for v0.135.0 (workaround until this is merged)
Since the repo does not accept external PRs, here is a binary patch that fixes the URL path in the pre-built npm binary. This lets users on v0.135.0 use
amazon-bedrockprovider immediately without waiting for an official release.The technique
The Codex binary assembles the Mantle URL via
format!("https://bedrock-mantle.{region}.api.aws/openai/v1"). Rust compiles this into two string pieces:"https://bedrock-mantle."and".api.aws/openai/v1"(18 bytes). The SDK then appends/responsesafter callingbase_url.trim_end_matches('/').We exploit
trim_end_matches('/')by replacing.api.aws/openai/v1(18 bytes) with.api.aws/v1///////(18 bytes, 7 trailing slashes). Same byte length — no need to find Rust's(ptr, len)metadata. Aftertrim_end_matches('/'), the URL collapses to the correcthttps://bedrock-mantle.{region}.api.aws/v1, and/responsesis appended normally.Script
Verification after patching
The
features.*=falseflags are needed due to a separate issue wherenamespace_toolswrapping is incompatible with Mantle (tracked in #25034).Notes
npm update @openai/codex(which overwrites the binary)codesign --force --sign -after patching, otherwise the binary is killed on execcodex-linux-x64instead ofcodex-darwin-arm64Additional context from my side.
The patch mentioned in this issue appears to target npm-installed versions of Codex. Since I installed Codex via Homebrew, I have not been able to apply and test that patch in my environment.
Also, my understanding is that changes to the Codex repository generally require review and action from project maintainers. Given the current volume of open issues and pull requests, I wonder if this issue may have been overlooked or buried among other reports.
Based on the investigation and testing shared in this thread, it seems increasingly likely that the problem is related to the endpoint used by the
amazon-bedrockprovider rather than user configuration.If a Codex maintainer or contributor sees this issue, could you please take a look at the endpoint implementation used by the
amazon-bedrockprovider and determine whether it needs to be updated?It would be greatly appreciated, as this issue may affect other users attempting to use Codex with AWS Bedrock Mantle as well.
Thank you for your time and assistance.
It looks like this issue is related to the previously reported #21352, which has since been closed.
However, as far as I can tell, the underlying problem does not appear to be resolved yet:
amazon-bedrockprovider still sends requests to/openai/v1/responses./v1/responses.404 Not Found./v1base URL works correctly as a workaround.Could you clarify why #21352 was closed? Was it considered a duplicate, or was it believed to be fixed?
If it was closed as fixed, this issue is still reproducible with the current implementation and appears to require an actual code change.
for GPT 5.4/5.5, Amazon Bedrock Mantle expects /openai/v1/responses, unlike gpt-oss。
@kingdoooo
Thanks for pointing this out.
I found this AWS blog post about GPT-5.5 / GPT-5.4 and Codex on Amazon Bedrock:
https://aws.amazon.com/jp/blogs/news/get-started-with-openai-gpt-5-5-gpt-5-4-models-and-codex-on-amazon-bedrock/
I’ll try configuring Mantle to use
/openai/v1/responsesfor GPT-5.4 / GPT-5.5, since that seems to be expected on Amazon Bedrock, unlikegpt-oss.I've confirmed this works with GTP-5.5, so I'll switch to using GTP-5.5. Thank you — I'll close this issue.