codex-responses-api-proxy fails with "API key is too large to fit in the 1024-byte buffer" when using Azure AD access tokens

Open 💬 4 comments Opened Apr 8, 2026 by stias

What issue are you seeing?

The proxy should accept API keys / bearer tokens longer than 1024 bytes. Calling the Azure OpenAI Responses API directly with the same token via curl works correctly, confirming the token itself is valid.

What steps can reproduce the bug?

  1. Obtain an Azure AD access token:

az account get-access-token \
--resource https://cognitiveservices.azure.com \
--query accessToken -o tsv

  1. Confirm the token size exceeds 1024 bytes:

az account get-access-token \
--resource https://cognitiveservices.azure.com \
--query accessToken -o tsv | wc -c # outputs ~1400–1800

  1. Use the token as openai-api-key in codex-action with responses-api-endpoint set to an Azure OpenAI endpoint.
  1. The action fails at the "Start Responses API proxy" step with:

Error: API key is too large to fit in the 1024-byte buffer

What is the expected behavior?

When using an Azure AD access token (obtained via az account get-access-token --resource https://cognitiveservices.azure.com --query accessToken -o tsv) as the openai-api-key input, codex-responses-api-proxy fails immediately with:

Error: API key is too large to fit in the 1024-byte buffer

Azure AD JWT access tokens are typically 1200–1800 bytes, which exceeds the proxy's fixed 1024-byte stdin read buffer. This causes the action to time out and report "responses-api-proxy did not write server info".

Additional information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗