Allow provider configs to inject custom request-body fields
Open 💬 6 comments Opened Oct 21, 2025 by MarianoFacundoArch
What feature would you like to see?
Add a config option (e.g., model_providers.<id>.extra_body) that lets us merge arbitrary JSON into the POST body for both Responses and Chat providers so we can turn on vendor-specific capabilities such as Anthropic’s thinking block.
Additional information
Right now Codex always sends the same minimal payload, which prevents enabling Claude’s extended thinking (thinking: { type: "enabled", budget_tokens: N }). A per-provider payload hook would unlock that while keeping defaults unchanged, ideally with validation that merges cleanly and preserves the existing fields.
6 Comments
[Codex analysis on how to add this capability].
I previously raised an issue about
extra_body: https://github.com/openai/codex/issues/4267, but it was closed by them.I did a local repro against NVIDIA-hosted NIM and put the artifacts here:
The important split is that
#5458still looks relevant, but it does not seemto be the first blocking boundary on the tested hosted NVIDIA path.
Exact results:
wire_api = "responses"todayGET https://integrate.api.nvidia.com/v1/modelsreturned200POST https://integrate.api.nvidia.com/v1/responsesreturned404 page not found/v1/responses404also appeared in a widened six-model matrix onthe same hosted Integrate surface across NVIDIA, Meta, and Mistral instruct
models
codex execthrough a custom provider configured forhttps://integrate.api.nvidia.com/v1failed on that same/v1/responsesboundary
POST /v1/chat/completionswithnvidia/nemotron-3-super-120b-a12breturned200chat_template_kwargs.force_nonempty_content = trueguidancematerially changed the chat response shape in the fallback test
NVIDIA's current LLM NIM release notes describe experimental
ResponsesAPIsupport, so this looks more like a real hosted compatibility/data point than a
local config typo.
The strongest current read I can support is:
chat/completionsproviders because
/v1/responsesreturns404quirk
semantics later,
#5458still looks like the right place for theprovider-level request-body-tuning part
I pushed the NVIDIA separation one step further and updated the repro repo:
The new part is a real self-hosted NIM run on local hardware, not just the hosted Integrate checks.
Exact results:
umbra(RTX 4090, Windows/NVIDIA driver595.79), a warmed self-hosted NIM deployment now returns:GET /v1/health/ready->200GET /v1/models->200POST /v1/chat/completions->200POST /v1/responses->404/v1/chat/completions,/v1/models, and/v1/health/ready, but not/v1/responsesSo the first blocker on the tested NVIDIA paths is no longer just "hosted Integrate returns 404 on
/v1/responses". The same missing Responses boundary also shows up on the first self-hosted NIM route I was able to bring up.That keeps
#5458relevant as a later primitive if a working NVIDIA Responses route appears and still needs provider-level request-body tuning, but it still does not look like the first blocking boundary on the tested NVIDIA routes.I pushed the stronger local workaround tranche here:
This still does not change the first blocking boundary on the tested
NVIDIA routes: native
/v1/responsesis still missing on both the hosted andfirst self-hosted path I tested.
What is materially stronger now is the local workaround story.
Exact results:
/v1/responsesby translating Codexrequests into NVIDIA
chat/completionscodex execnow succeeds end-to-end through that shim on the testedself-hosted NIM route
OKreal 69.47request still times out at
120s200in187.466568s200in58.247264sscripts/smoke-codex-shim-cold-start.shconfigs/nim.minimal-profile.prewarm-request.json200in180.839636sOKreal 323.73metadata warning on configured providers; after that, the next exposed seams
were shim
/v1/modelscompatibility details and self-hosted cold-startlatency, not the old metadata warning
So the current split I can support is:
/v1/responsesavailability is still the first blocker fordirect Codex custom-provider use on the tested paths
self-hosted path work end-to-end today
Codex-side patch from the NIM-specific workaround repo
Concrete workaround/data point for the chat-only upstream case: we just published the local adapter we are using to run DeepSeek V4 in Codex today:
https://github.com/holo-q/deepseek-responses-proxy
It exposes a local Responses-compatible endpoint to Codex and forwards to an OpenAI-compatible
/chat/completionsupstream. Current working config on Codex 0.128.0:For DeepSeek V4 specifically, the adapter also preserves/replays
reasoning_contentin chat history when tool calls are involved, which DeepSeek rejects if lost between turns.This does not remove the need for provider-level
extra_body; that would still be the clean native primitive for provider-specific knobs. But for upstreams that only expose/chat/completionswhile Codex wantswire_api = "responses", a thin local Responses->Chat adapter is enough to make it usable today.