-
Notifications
You must be signed in to change notification settings - Fork 87
Sharing an OpenClaw → codex-lb integration experience #219
Description
Hi, thanks again for codex-lb — it has been very useful.
I wanted to share an OpenClaw integration experience in case it is useful for docs or for other users trying a similar setup.
I initially followed the generic OpenAI-compatible route and connected OpenClaw to codex-lb through:
http://127.0.0.1:2455/v1
That path does work, and it makes sense as the default recommendation because it is the simplest OpenAI-compatible setup.
However, after real OpenClaw-side testing, I ran into some compatibility issues on that route, especially around usage/accounting behavior.
Because of that, I looked at how OpenClaw natively talks to Codex in its OAuth-based flow, and traced it back to the openai-codex-responses path. From there, I tried aligning the chain more closely like this:
- OpenClaw
openai-codex-responses- codex-lb
/backend-api/codex
That turned out to be a better fit for Codex-style behavior.
During that process, I also found an important client-side compatibility issue on the OpenClaw side:
- OpenClaw’s stock
openai-codex-responsesimplementation assumes an official ChatGPT/Codex JWT - it tries to forcibly extract
chatgpt_account_id - and it assumes
chatgpt-account-idshould always be sent
That works for the official ChatGPT/Codex backend, but it does not work well with third-party Codex-compatible backends such as codex-lb, where opaque bearer tokens may be valid and chatgpt-account-id may not be required.
What worked well for me was a narrow client-side adjustment:
- keep official
chatgpt.combehavior strict - but for non-official Codex-compatible base URLs, allow bearer-token passthrough even when
chatgpt_account_idcannot be extracted - only send
chatgpt-account-idwhen an actual account ID was extracted
After that adjustment, the OpenClaw → openai-codex-responses → codex-lb → /backend-api/codex path behaved much better for my Codex-style workflow than the generic /v1 path.
Just sharing this in case it is useful for future OpenClaw integration notes or for other users trying the same route.