Disclaimer (May 2026). Sorry for the long radio silence on the comments, busy stretch on my side. I no longer use this setup and stopped tracking it actively. I'm refreshing the page out of thoroughness because comments kept coming in and people deserve an honest snapshot. If you find better workarounds, post them in the comments and I'll link them, but I won't be maintaining this further.
Codex deprecated wire_api = "chat" in favour of OpenAI's Responses API. DeepSeek only speaks Chat Completions, so the direct integration documented below is no longer reliable. Symptoms reported by users:
An assistant message with 'tool_calls' must be followed by tool messages...(insufficient tool messages following tool_calls)Missing 'reasoning_content' field in the assistant message at message index N