chenyme/grok2api

Multi-account API gateway for Grok Build, Grok Web, and Grok Console

What it solves

Grok2API provides a unified API gateway for accessing Grok models across different platforms (Grok Build, Grok Web, and Grok Console). It allows users to manage multiple accounts and expose these capabilities through OpenAI- and Anthropic-compatible APIs, simplifying integration with tools like Codex and Claude Code.

How it works

The project is a Go-based gateway with a React admin console. It routes requests through a Provider Registry that manages independent account pools for Build, Web, and Console. It handles authentication, quota synchronization, and model discovery. To ensure connectivity, it includes an Egress Manager that supports various proxy tunnels (e.g., SOCKS5, Trojan, VLESS) and optional quality guards to monitor node health.

Who it’s for

Developers and technical researchers who want to centralize their Grok account access, bypass platform-specific API limitations, and integrate Grok's capabilities into third-party AI SDKs or specialized coding agents.

Highlights

  • Multi-Provider Support: Manages Grok Build, Web, and Console accounts independently.
  • Unified API: Exposes OpenAI- and Anthropic-compatible endpoints for chat, images, video, and voice.
  • Multimodal Capabilities: Supports image generation/editing, asynchronous video jobs, TTS, and STT.
  • Advanced Routing: Features model discovery, sticky sessions, quota guards, and bounded failover.
  • Flexible Egress: Comprehensive proxy support with subscription imports and automated fallback mechanisms.
  • Admin Console: Built-in React dashboard for managing keys, routes, and account audits.

Related

  • Project
  • Project
  • Project
  • Project
  • Project