Skip to content

[FEATURE] Custom External API Endpoints in modelMapping #320

Description

@peroxide-dev

Feature Request: Custom External API Endpoints in modelMapping

Summary

Allow modelMapping in config.json to route specific model names to external OpenAI-compatible API endpoints (e.g. NVIDIA NIM, Together AI, Groq), not just alias or hide existing Antigravity-provided models.

Motivation

Currently, modelMapping only supports aliasing and visibility control for models already provided by Antigravity's backend. There is no way to add custom models backed by external APIs.

Users who want to use Claude Code with a mix of Antigravity-provided models (Gemini, Claude) and external models (e.g. NVIDIA's GLM-5, DeepSeek V3, Kimi K2) currently have no clean way to do this. Workarounds like LiteLLM fail because they don't handle Claude Code's Anthropic-specific tool schemas correctly — only this proxy does.

Proposed Solution

Extend modelMapping to support optional external routing fields:

"modelMapping": {
  "glm-5": {
    "hidden": false,
    "endpoint": "https://integrate.api.nvidia.com/v1/chat/completions",
    "apiKey": "YOUR_API_KEY",
    "model": "z-ai/glm5"
  },
  "deepseek-v3": {
    "hidden": false,
    "endpoint": "https://integrate.api.nvidia.com/v1/chat/completions",
    "apiKey": "YOUR_API_KEY",
    "model": "deepseek-ai/deepseek-v3.2"
  }
}

When endpoint and model are present, the proxy would:

  1. Forward the request to the specified external endpoint instead of Antigravity's backend
  2. Still handle all the Anthropic ↔ OpenAI tool schema translation that makes this proxy uniquely compatible with Claude Code
  3. Return the response in Anthropic format as usual

Why This Proxy Is the Right Place for This

The key value of this proxy is its translation layer between Claude Code's Anthropic-specific tool schemas and OpenAI-compatible APIs. LiteLLM and other generic proxies fail with Claude Code because they don't handle this translation. Adding external endpoint support here would make this the single unified solution for Claude Code users who want access to multiple model providers.

Alternatives Considered

  • LiteLLM: Fails due to Anthropic-specific tool schemas (422 errors)
  • Multiple proxies: Messy, Claude Code can only point to one ANTHROPIC_BASE_URL
  • Modifying proxy source: Possible but not maintainable for end users

Additional Context

NVIDIA NIM free tier provides access to models like GLM-5, DeepSeek V3, Kimi K2, Qwen3 Coder, and Llama 4 — all of which would be great complements to the Gemini models already supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions