Menu

1 / 2

"How I Made Claude Code, Codex, and Gemini CLI Share One Local API"

DEV Community·CodeKing·6 months ago
#HDbWN1rB
#tutorial#webdev#responses#request#codex
Reading 0:00
15s threshold

I got tired of debugging my AI tooling by reading HTTP traces instead of writing code.

Claude Code wanted Anthropic Messages. Codex CLI wanted OpenAI Responses, and sometimes its own internal /backend-api/codex/responses path. Gemini CLI wanted Google's v1beta/models/* endpoints. Every tool acted like its protocol was the normal one.

The annoying part was not auth. It was compatibility.

If I wanted one local gateway for all three tools, I needed to solve three problems at once:

different request schemas

different streaming formats

different assumptions about images, tools, and model names

The Before State

Before this project, "use one local proxy for all my AI coding tools" sounded simpler than it was.

Claude Code expects POST /v1/messages .

Codex CLI can hit:

POST /v1/responses POST /backend-api/codex/responses

Enter fullscreen mode

Exit fullscreen mode

Gemini CLI expects routes like:

POST /v1beta/models/{model}:generateContent POST /v1beta/models/{model}:streamGenerateContent

Enter…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.