Running CLIProxyAPI as one API for every coding model

I run CLIProxyAPI as a local proxy that exposes all the AI coding models I have access to behind a single Anthropic/OpenAI-style API, which I then point OpenCode at through a custom provider block. I set it up mainly to track my token usage so I can tell when a deal is actually worth it, and to avoid re-authenticating with eight providers across my desktop and laptop. Through it I use Gemini 3 Pro, the Opus and Sonnet models that Google's Antigravity gives out for free, GLM and the GPT-5.2 Codex variants.

I use CLIProxyAPI to put all the models I have access to behind one API. You do not need it to use Z.ai, but I went with it for Google's Antigravity so I could avoid their own thing and use Opus as a normal Anthropic/OpenAI API instead. The other reasons are practical: it lets me track token usage so I know when something is a good deal for me, and it saves me from re-authing to eight providers on both desktop and laptop. It also serves Gemini's API, which is a bit off from the OpenAI standard.

Connecting it to OpenCode is super not obvious and took me a while to dig out, but you can just add a custom provider pointing at the local proxy:

"provider": {
    "dzervart": {
      "models": {
        "gemini-3-pro-preview": {
          "name": "gemini-3-pro"
        },
        "gemini-claude-opus-4-5-thinking": {
          "name": "opus-4.5"
        },
        "gemini-sonnet-claude-4-5-thinking": {
          "name": "sonnet-4.5"
        },
        "glm-4.7": {
          "name": "glm-4.7"
        },
        "gpt-5.2(high)": {
          "name": "gpt-5.2"
        },
        "gpt-5.2-codex(high)": {
          "name": "gpt-5.2-codex-high"
        },
        "gpt-5.2-codex(medium)": {
          "name": "gpt-5.2-codex"
        }
      },
      "name": "DZervArt",
      "npm": "@ai-sdk/anthropic",
      "options": {
        "apiKey": "sk-dummy",
        "baseURL": "https://localhost:5834/v1"
      }
    }
  },

If you do not want to mess with CLIProxyAPI there is also opencode-antigravity-auth. Codex is built into OpenCode now, and OpenCode 1.1.11 still supports Anthropic, although you might get banned or limited since they are actively hunting down non-Claude CLI usage. It is very early to tell how that will pan out.

For GLM I lower the temperature to 0.3 to 0.5 and update my agents to steer towards smaller code generation. I also bought a month of Claude Pro against my own judgement, and it is almost useless with the limits. Claude Code is still very good, especially how it manages command permissions, and OpenCode is a tad worse there, which is a bit scary, but fixing the irritating issue where Gemini's Opus would stop after every tool call made it awesome.

One idea I floated: pooling everyone's AI access, subscription or not, so that between different usage patterns and timezones there are always available limits, plus one API that works with literally everything.