Skip api.openai.com/v1/models refresh when using custom responses-api-endpoint

Resolved 💬 2 comments Opened Feb 9, 2026 by Ferrus91 Closed Feb 10, 2026

Problem

When using codex-action@v1.4 with a custom responses-api-endpoint (e.g., an in-house OpenAI-compatible proxy), the Codex CLI still calls https://api.openai.com/v1/models on startup to refresh available models.

If the API key is issued for the custom endpoint and not for OpenAI directly, this call always fails with a 401 Unauthorized:

ERROR codex_core::models_manager::manager: failed to refresh available models:
unexpected status 401 Unauthorized: Missing bearer authentication in header,
url: https://api.openai.com/v1/models?client_version=0.98.0

The error is non-fatal (the CLI continues), but it's noisy and confusing in CI logs.

Expected behavior

When a custom responses-api-endpoint is configured, the CLI should either:

  • Skip the api.openai.com/v1/models refresh entirely, or
  • Call the custom endpoint's /v1/models instead, or
  • Provide a flag to disable the model refresh (e.g., --skip-model-refresh)

Reproduction

  1. Configure codex-action@v1 with a custom responses-api-endpoint and an API key that is valid only for that endpoint
  2. Run the action
  3. Observe the 401 error in logs from the direct api.openai.com/v1/models call

Environment

  • Codex CLI v0.98.0
  • openai/codex-action@v1
  • Using responses-api-endpoint pointed at an in-house proxy

View original on GitHub ↗

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