Status: [UNTESTED] Endpoints found: http://localhost:3000/v1/messages http://localhost:3000/v1/responses http://localhost:3000/v1/models Source: https://github.com/fugaofugaofugao/new-api-gemini-compat # new-api-gemini-compat A small compatibility proxy for using Gemini models served by [new-api](https://github.com/Calcium-Ion/new-api) with Claude Code-style Anthropic Messages clients and OpenAI Responses-style clients. It sits in front of new-api, proxies normal traffic unchanged, and translates selected Gemini requests: - `POST /v1/messages` -> `POST /v1/chat/completions` - `POST /v1/responses` -> `POST /v1/chat/completions` - `GET /v1/models` adds `anthropic` and `openai-response` endpoint hints to Gemini models This is a practical compatibility layer, not a full Anthropic API implementation. ## Why new-api can expose Gemini through an OpenAI-compatible Chat Completions API, but tools such as Claude Code, cc-switch setups, and OpenAI Responses-style clients may send request shapes that Gemini/new-api does not accept directly. This proxy converts the common request and streaming event formats so those clients can use Gemini models through new-api. ## Features - Anthropic Messages request conversion - `system`, `messages`, text parts, base64 images, `tools`, `tool_choice` - Claude `tool_use` and `tool_result` conversion - OpenAI Responses request conversion - `input`, `instructions`, function tools, function call outputs - Streaming conversion - Chat Completions SSE -> Anthropic Messages SSE - Chat Completions SSE -> OpenAI Responses SSE - Tool call streaming - OpenAI/Gemini `tool_calls` -> Claude `tool_use` - OpenAI/Gemini `tool_calls` -> Responses `function_call` - Gemini output token floor - Raises too-small Gemini output budgets with `GEMINI_MIN_OUTPUT_TOKENS` ## Limitations This proxy is intentionally narrow. It is designed for common Claude Code, cc-switch, Codex CLI, and Responses-style usage through Gemini/new-api. It does not claim complete compatibility with: - every Anthropic Messages API field - every Claude Code beta header or future client behavior - Anthropic extended thinking blocks - server tools - document/file cont