fix(providers): use dedicated openai-codex provider instead of aliasing to openai

Codex OAuth tokens use the ChatGPT backend API (chatgpt.com), not the
standard OpenAI API (api.openai.com). pi-ai already has a dedicated
openai-codex provider with the correct API format (openai-codex-responses)
and base URL. Remove the alias that was incorrectly mapping openai-codex
to openai, which caused 401 errors due to missing scopes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jiang Bohan 2026-02-13 15:01:57 +08:00
parent 7578946990
commit 13fbeaf4d2

View file

@ -126,7 +126,8 @@ const PROVIDER_REGISTRY: Record<string, ProviderMeta> = {
*/
export const PROVIDER_ALIAS: Record<string, string> = {
"claude-code": "anthropic", // Claude Code OAuth uses anthropic API
"openai-codex": "openai", // Codex OAuth uses OpenAI API
// Note: openai-codex is NOT aliased — pi-ai has a dedicated openai-codex provider
// that uses the Codex-specific API (openai-codex-responses) and base URL (chatgpt.com)
};
// ============================================================