AIToolScan

AIHubMix

AIHubMix Overview

AIHubMix is a unified AI model gateway providing 500+ models from OpenAI, Anthropic, Google, and leading open-source providers behind one API key, with four wire protocols (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, Google Gemini). Officially authorized model reseller, deployed on Google Cloud (US).

  • 500+ Models in One API: Access GPT-5, Claude Opus/Sonnet, Gemini, DeepSeek, Qwen, Doubao, and more through a single unified endpoint.
  • OpenAI-Compatible API: Zero code changes needed — just point your base URL to https://aihubmix.com and swap the API key.
  • Four Wire Protocols: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Google Gemini native — pick whichever your SDK expects.
  • Smart Routing: Set model to auto and the gateway picks the best model based on cost, quality, or latency strategies.
  • Model Mapping & Failover: Per-key model aliasing with automatic failover — zero client changes needed when upstream providers have issues.
  • Structured Output Repair: Malformed JSON responses are automatically repaired at the gateway level.
  • Official Authorization: Authorized reseller for Microsoft Azure, AWS, GCP, Alibaba Cloud, and Baidu Cloud models.
  • Google Cloud Deployment: All services deployed on Google Cloud (US) for high availability and low latency.
  • Playground: Try any model in the browser at playground.aihubmix.com.
  • Agent-Ready: Machine-readable guides (llms.txt, agents.md), AIHubMix Skills, MCP server, and deep links for Claude Code, Codex, Cursor.

Using AIHubMix with OpenCode

OpenCode is an AI coding agent built for the terminal. AIHubMix is a first-class provider for OpenCode.

Method 1: Auth Login (Recommended)

  1. Install OpenCode: npm install -g opencode-ai or curl -fsSL https://opencode.ai/install | bash
  2. Run opencode auth login
  3. Select AiHubMix as the model provider
  4. Enter your AIHubMix API Key
  5. Start using: opencode then type /models and search for aihubmix

Method 2: Manual Configuration

Edit ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "aihubmix": {
      "models": {
        "gpt-5": { "name": "GPT-5", "contextLength": 128000, "type": "language" },
        "claude-sonnet-4-5": { "name": "Claude Sonnet 4.5", "contextLength": 200000, "type": "language" },
        "deepseek-v4-pro": { "name": "DeepSeek-V4-Pro", "contextLength": 131072, "type": "language" }
      }
    }
  }
}

Custom Base URL

Add options.baseURL under the aihubmix provider for custom gateways or proxies:

{
  "provider": {
    "aihubmix": {
      "options": { "baseURL": "https://api.inferera.com" }
    }
  }
}

Only specify the domain level — /v1 paths are appended automatically.

Recommended OpenCode Models

  • coding-minimax-m2.1-free — Free coding model
  • coding-glm-4.7-free — Free coding model
  • claude-sonnet-4-5 — Best for complex coding tasks
  • gpt-5 — General purpose
  • gpt-5-codex — Optimized for code generation

Using AIHubMix with Claude Code

Claude Code uses the Anthropic Messages protocol. Configure with environment variables:

macOS / Linux (zsh)

echo 'export ANTHROPIC_BASE_URL="https://aihubmix.com"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-key"' >> ~/.zshrc
echo 'export ANTHROPIC_MODEL="claude-sonnet-4-5"' >> ~/.zshrc
source ~/.zshrc

Windows (PowerShell)

[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-your-key", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://aihubmix.com", [EnvironmentVariableTarget]::User)
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-sonnet-4-5", [EnvironmentVariableTarget]::User)

Verify

claude -p "1+1, output only the answer" --model claude-sonnet-4-5

If it returns 2, Claude Code is configured successfully.

Using AIHubMix with OMO (Oh My OpenAgent)

OMO (Oh My OpenAgent) is a powerful agent framework extending OpenCode and Codex CLI with 11 discipline agents, 54+ lifecycle hooks, and built-in MCPs.

OMO Ultimate (OpenCode) + AIHubMix

  1. Install OpenCode and configure AIHubMix as shown above
  2. Install OMO: bunx oh-my-openagent install
  3. OMO detects AIHubMix as a provider and lets you select models across its 11 agent roles
  4. Each agent (code reviewer, test writer, debugger, etc.) can use different AIHubMix models

OMO Light (Codex CLI) + AIHubMix

# Install OMO Light for Codex CLI
npx lazycodex-ai install

# Configure Codex CLI to use AIHubMix
export OPENAI_API_KEY="sk-your-key"
export OPENAI_BASE_URL="https://aihubmix.com/v1"

# Start Codex with OMO
codex

OMO Senpi (Standalone) + AIHubMix

# Install OMO standalone
npm i -g omo-ai@beta

# Configure
export OPENAI_API_KEY="sk-your-key"
export OPENAI_BASE_URL="https://aihubmix.com/v1"

# Run OMO
omo

Using AIHubMix with Codex CLI

export OPENAI_API_KEY="sk-your-key"
export OPENAI_BASE_URL="https://aihubmix.com/v1"
codex

Using AIHubMix with Cursor

  1. Open Cursor Settings → Models
  2. Add OpenAI API Key: your AIHubMix key
  3. Set OpenAI API Base URL: https://aihubmix.com/v1
  4. Select any model from the AIHubMix catalog

Gateway Features

  • Smart Routing (model: auto): The gateway automatically picks the best model based on your strategy.
  • Model Mapping & Failover: Create model aliases per API key with automatic failover.
  • Structured Output Repair: Malformed JSON responses are automatically fixed at the gateway level.
  • Image Generation: Unified image API at /ai/v1/images/generations across providers.
  • Async Tasks: Media task lifecycle management with create, poll, download, and webhook support.

API Endpoints Summary

ProtocolEndpointAuth Header
OpenAI Chat CompletionsPOST /v1/chat/completionsAuthorization: Bearer key
OpenAI ResponsesPOST /v1/responsesAuthorization: Bearer key
Anthropic MessagesPOST /v1/messagesx-api-key: key + anthropic-version: 2023-06-01
Google GeminiPOST /gemini/v1beta/models/{model}:generateContentx-goog-api-key: key

Pros (Good Points)

  • One key for everything: 500+ models from all major providers with a single API key and unified billing.
  • Zero migration cost: OpenAI-compatible API means existing code works with just a URL and key change.
  • Official authorization: Legally authorized reseller — not a proxy, but an official partner.
  • Smart routing & failover: Automatic model selection and failover keeps your app running.
  • Agent-ready: Machine-readable guides, Skills, MCP, and deep links for all major coding agents.
  • Competitive pricing: Pay-as-you-go with no subscription — pricing aligned to original providers.

Cons (Bad Points)

  • Network dependency: All requests go through US-based Google Cloud — users in Asia may experience higher latency.
  • No free tier: Pay-as-you-go only — no free credits for experimentation.
  • Claude model markup: Claude models may have different pricing than direct Anthropic access.
  • Limited custom models: Cannot add custom or self-hosted models to the gateway.

Resources