grok2api
by
chenyme

Description: Grok2API 是一个基于 FastAPI 构建的 Grok 网关,支持将 Grok Web 能力以 OpenAI 兼容 API 的方式转换。

View on GitHub ↗

Summary Information

Updated 56 minutes ago
Added to GitGenius on February 13th, 2026
Created on October 10th, 2025
Open Issues & Pull Requests: 3 (+0)
Number of forks: 1,852
Total Stargazers: 5,378 (+1)
Total Subscribers: 12 (+0)

Issue Activity (beta)

Open issues: 3
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 0 days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • question (148)
  • bug (133)
  • enhancement (78)
  • duplicate (17)
  • help wanted (4)
  • invalid (4)
  • wontfix (4)
  • documentation (3)

Most active issues this week

Repository Insights (GitGenius)

Median issue/PR response: 0.0 hours
Mean response time: 23.9 hours
90th percentile: 47.1 hours
Tracked items: 389

Most active contributors

Detailed Description

Grok2API is a FastAPI-based gateway that converts Grok Web capabilities into OpenAI-compatible API endpoints. The project enables developers to access Grok's chat, image generation, image editing, and video generation features through standardized API interfaces that follow OpenAI conventions, alongside partial Anthropic Messages API compatibility.

The repository implements comprehensive API endpoints covering chat completions, model listing, image generation and editing, video creation and retrieval, and response handling. It supports both streaming and non-streaming responses, explicit thinking output, function tool structures, and unified token and usage statistics. The system includes local caching for images and videos with proxy link returns, multi-account pooling with hierarchical account selection, failure feedback mechanisms, quota synchronization, and automatic account maintenance.

The project provides multiple user interfaces accessible through different paths. An Admin backend at /admin/login handles account management, configuration management, and cache management. A WebUI chat interface at /webui/chat offers conversational capabilities, while /webui/masonry provides image generation functionality and /webui/chatkit offers voice-enabled chat. Authentication rules vary by scope, with /v1/* endpoints requiring an API key when configured, /admin/* endpoints using an app key defaulting to "grok2api", and /webui/* endpoints optionally requiring a webui key.

Configuration operates across three layers: environment variables applied at startup, runtime configuration in config.toml that takes effect immediately upon saving, and default templates used during initialization. The system supports extensive environment variable configuration including timezone, logging levels, account synchronization intervals, server host and port settings, data directory paths, and multiple account storage backends including local SQLite, Redis, MySQL, and PostgreSQL with configurable connection pooling.

The supported model catalog includes multiple Grok chat variants spanning different tiers and modes, from basic fast models to super and heavy tier reasoning models. Image generation models range from lite to pro versions, with dedicated image editing capabilities. Video generation uses the grok-imagine-video model. All models are retrievable through the GET /v1/models endpoint.

According to GitGenius activity tracking, the repository has processed 389 issues and pull requests with a median response latency of zero hours and mean latency of 23.9 hours. The most active labels are question with 148 items, bug with 133 items, and enhancement with 78 items. Primary contributor chenyme generated 774 tracked events, with leadscloud and dq52099 contributing 15 and 14 events respectively. The repository shares overlapping contributors with github/gh-aw, solo-io/gloo, and longhorn/longhorn.

The project has entered maintenance mode with an official discontinuation notice. The README explicitly states that due to limited personal capacity and official risk control concerns, Grok2API has ceased active development. While the x-statsig-id can still be obtained through alternative methods, the repository code is archived for learning and research purposes only, with no further feature development, bug fixes, or technical support planned. The maintainer recommends their new project DEEIX-Chat as an alternative, described as a lightweight enterprise-grade AI platform with unified model routing, conversation, file handling, tools, billing, identity, and operations capabilities.

grok2api
by
chenymechenyme/grok2api

Repository Details

Fetching additional details & charts...