Summary
A caller can send prompt_cache_key as an optional string to /v1/responses.
OpenCodex's Responses parser writes the value to options.promptCacheKey.
createOpenAIChatAdapter().buildRequest() builds the outbound /chat/completions body without that value.
The OpenAI Chat Completions Create API lists prompt_cache_key as an optional string.
OpenAI uses the key to group similar requests for prompt caching and improve cache hit rates.
OpenCodex should copy parsed.options.promptCacheKey to body.prompt_cache_key without changing the string.
OpenCodex should omit the upstream field if the caller does not send it.
Reproduction
-
Add a provider that uses the openai-chat adapter.
-
Send a Responses request with prompt_cache_key.
curl http://127.0.0.1:10100/v1/responses \
-H 'Content-Type: application/json' \
-d '{
"model": "example/example-model",
"input": "Hello",
"prompt_cache_key": "shared-prefix-v1",
"stream": false
}'
-
Capture the request that OpenCodex sends to the provider's /chat/completions endpoint.
-
Confirm that the outbound body lacks prompt_cache_key.
Logs and screenshots
src/responses/schema.ts
prompt_cache_key: z.string().optional()
src/responses/parser.ts
options.promptCacheKey = data.prompt_cache_key
src/adapters/openai-chat.ts
createOpenAIChatAdapter().buildRequest() constructs the body without prompt_cache_key
Expected outbound field:
prompt_cache_key="shared-prefix-v1"
Area
Provider adapter
Version
2.7.30
OS
macOS 26.5.2 (arm64)
Config shape
{
"defaultProvider": "example",
"providers": {
"example": {
"adapter": "openai-chat",
"baseUrl": "https://example.invalid/v1",
"authMode": "key",
"apiKey": "<redacted>",
"defaultModel": "example-model"
}
}
}
Checks
Summary
A caller can send
prompt_cache_keyas an optional string to/v1/responses.OpenCodex's Responses parser writes the value to
options.promptCacheKey.createOpenAIChatAdapter().buildRequest()builds the outbound/chat/completionsbody without that value.The OpenAI Chat Completions Create API lists
prompt_cache_keyas anoptional string.OpenAI uses the key to group similar requests for prompt caching and improve cache hit rates.
OpenCodex should copy
parsed.options.promptCacheKeytobody.prompt_cache_keywithout changing the string.OpenCodex should omit the upstream field if the caller does not send it.
Reproduction
Add a provider that uses the
openai-chatadapter.Send a Responses request with
prompt_cache_key.Capture the request that OpenCodex sends to the provider's
/chat/completionsendpoint.Confirm that the outbound body lacks
prompt_cache_key.Logs and screenshots
Area
Provider adapter
Version
2.7.30
OS
macOS 26.5.2 (arm64)
Config shape
{ "defaultProvider": "example", "providers": { "example": { "adapter": "openai-chat", "baseUrl": "https://example.invalid/v1", "authMode": "key", "apiKey": "<redacted>", "defaultModel": "example-model" } } }Checks