Skip to content

[BUG] gpt-5-codex model returns 404 error when using v1/chat/completions endpoint #4480

Closed

Description

@BEOKS

What version of Codex is running?

Codex CLI v0.42.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

  1. Run codex command
  2. Use API key authentication
  3. Change model to gpt-5-codex using /model command
  4. Send any message (e.g., "hello")
  5. Observe the 404 error with retry attempts

What is the expected behavior?

The gpt-5-codex model should work properly with the Codex CLI without returning 404 errors. The model should respond to user queries successfully.

What do you see instead?

⚠️ stream error: unexpected status 404 Not Found: {
"error": {
"message": "This model is only supported in v1/responses and not in v1/chat/completions.",
"type": "invalid_request_error",
"param": "model",
"code": null
}
}; retrying 1/5 in 183ms…

⚠️ stream error: unexpected status 404 Not Found: {
"error": {
"message": "This model is only supported in v1/responses and not in v1/chat/completions.",
"type": "invalid_request_error",
"param": "model",
"code": null
}
}; retrying 2/5 in 380ms…

Additional information

The error message clearly indicates that the gpt-5-codex model is only supported in the v1/responses endpoint, not in v1/chat/completions. This suggests that Codex CLI is using the wrong API endpoint for this specific model.

The system automatically retries the request (up to 5 times) but continues to fail with the same 404 error. This appears to be a configuration issue where Codex CLI needs to use the correct API endpoint for the gpt-5-codex model.

Environment:

  • macOS 24.5.0 (Sequoia)
  • Codex CLI v0.42.0
  • Model: gpt-5-codex
  • Working directory: ~/IdeaProjects/security-portal

Activity

  1. added
    bug
    on Sep 30, 2025
  2. BEOKS commented on Sep 30, 2025

    @BEOKS
    Author

    I fount that wire_api = "chat" option is problem!

  3. toreluntang commented on Feb 10, 2026

    @toreluntang

    Linking this #7782 as my google search brought me here (to no avail unfortunately)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions