Codex + Tencent LKEAP 401: It Was Not the Key
Описание и применение
Ошибка 401 возникла из‑за несовпадения протоколов: Codex ожидал Responses API, а endpoint LKEAP использует Chat Completions. Создан локальный прокси, переводящий запросы, и конфигурация обновлена.
Задача
Codex misinterpreted a Tencent LKEAP endpoint as a Responses API, appending "/responses" to a Chat Completions URL and causing a 401 error.
Результат
The 401 error was caused by a protocol mismatch; a local proxy successfully bridged the gap, allowing Codex to communicate with Tencent LKEAP.
Рабочий процесс
- Inspect the final request URL for unexpected path patterns.
- Confirm the client’s wire protocol (Responses vs Chat Completions).
- Verify the upstream endpoint’s expected URL shape.
- If mismatch, either adjust the client config or implement a local protocol adapter.
- Set up a local Node.js proxy that forwards Responses requests to the correct Chat Completions URL.
- Configure Codex to point to the proxy and provide a dummy OPENAI_API_KEY.
- Test the setup with a real Tencent LKEAP API key and validate responses.
- Document any remaining gaps (streaming, tool‑call traffic, error mapping).
Доказательства
unexpected status 401 Unauthorized
invalid configuration: wire_api = "chat" is no longer supported.
- Дата записи: 2026-09-05T13:58:38.697Z