400 Errors when attempting to use xAI
Resolved 💬 1 comment Opened Jun 19, 2025 by agileandy Closed Aug 7, 2025
What version of Codex is running?
0.1.2505172129
Which model were you using?
grok-3-mini
What platform is your computer?
MacBook Pro M3 Max
What steps can reproduce the bug?
Use Grok!
What is the expected behavior?
Grok to work as promised in the readme and supported providers list.
What do you see instead?
Logged in an authenticated on OpenAI. Environment variable set correctly (curl proves this), but Codex gives 400 errors
⚠️ OpenAI rejected the request. Error details: Status: 400, Code: unknown, Type: unknown, Message: 400 "Incorrect API
key provided: sk***gA. You can obtain an API key from https://console.x.ai.". Please verify your settings and try again.
The reference to SK** suggest it is trying to the OpenAI key for Grok, and not the Grok Key.
Additional information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗