Issue with first request after authenticating

Resolved 💬 6 comments Opened Jan 6, 2026 by anton-kalshi Closed Jan 6, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.78.0

What subscription do you have?

Pro

Which model were you using?

Default after installation

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

I login via Google oauth then immediately see when submitting first request

■ unexpected status 422 Unprocessable Entity: Failed to deserialize the JSON body into the target type: tools[5].type: unknown variant custom, expected one of function, web_search,
x_search, file_search, code_interpreter, mcp at line 1 column 18941, request id: 9b9dcd147a0fb15f-BOS

What steps can reproduce the bug?

I think probably most helpful is tracking the error server side based on my request id.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

6 Comments

etraut-openai contributor · 7 months ago

Are you using any non-default configuration options? For example, are you using a custom model provider? If you have any custom configuration options in your config.toml, please share.

anton-kalshi · 7 months ago

This happened both with or without custom models. My ~/.codex/config.toml is just

[projects."/Users/REDACTED"]
trust_level = "trusted"

When I launch codex it says

│ model:     gpt-5.2-codex   /model to change
etraut-openai contributor · 7 months ago

If this is something you can repro, please use the /feedback command to upload your logs and session data, then post the thread ID here.

anton-kalshi · 7 months ago

019b94ea-8c8d-73b0-93ce-22129c21ba93 - thank you

pakrym-oai contributor · 7 months ago

Your requests seem to be hitting https://api.x.ai/, do you have OPENAI_BASE_URL set by any chance?

anton-kalshi · 7 months ago

Yep, thank you. Thats my bad. Let me chase down why that's getting set. Sorry for taking up your time.

echo $OPENAI_BASE_URL
https://api.x.ai/v1