Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
import { register } from "../registry.ts";
import { FORMATS } from "../formats.ts";
import { openaiToAntigravityResponse } from "./openai-to-antigravity.ts";
// Gemini and Antigravity clients share the same Cloud Code
// `{ response: { candidates: [...] } }` envelope (see `unwrapGeminiChunk`
// callers in open-sse/utils/stream.ts, which treat FORMATS.GEMINI and
// FORMATS.ANTIGRAVITY identically). The response registry only had an
// OpenAI -> Antigravity projection registered, so an OpenAI-native provider
// serving a client whose request was detected as Gemini format (`sourceFormat`,
// e.g. a body-shape match on `contents: [...]`) streamed raw OpenAI
// `chat.completion.chunk` objects instead of the Gemini candidates envelope.
// Reuse the existing Antigravity projection — no new conversion logic needed.
register(FORMATS.OPENAI, FORMATS.GEMINI, null, openaiToAntigravityResponse);