Discover and explore top open-source AI tools and projects—updated daily.
jiujiu532Grok API gateway for OpenAI/Anthropic
New!
Top 40.1% on SourcePulse
<2-3 sentences summarising what the project addresses and solves, the target audience, and the benefit.> This project provides a FastAPI-based gateway that exposes Grok's capabilities through an OpenAI-compatible API. It targets developers and power users seeking to integrate Grok into applications, offering a standardized interface and advanced features like multi-account management and content generation APIs. The primary benefit is simplifying programmatic access to Grok's advanced AI models.
How It Works
Grok2API leverages FastAPI to create endpoints mirroring OpenAI's API structure, including /v1/chat/completions and /v1/messages (Anthropic compatible). It supports streaming responses, explicit reasoning output, and function tool passing. A key architectural choice is its robust multi-account pooling system, which manages diverse Grok accounts (paid and free console.x.ai tiers) with features like hierarchical selection, quota synchronization, and automatic maintenance. This approach abstracts Grok's underlying complexities, providing a unified and reliable access layer.
Quick Start & Requirements
Deployment is primarily via Docker Compose, offering both a standard direct-connect version and an "anti-ban" version integrating WARP, Privoxy, and FlareSolverr for Cloudflare-protected IPs. The standard Docker image is ghcr.io/jiujiu532/grok2api:latest. A single Docker container and local source installation (Python 3.13+, uv) are also supported. The anti-ban version requires server capabilities NET_ADMIN and SYS_MODULE (KVM/XEN virtualization). Setup via Docker Compose is typically under 10 minutes.
Highlighted Details
console.x.ai) accounts, including quota sync and auto-maintenance.Maintenance & Community
This repository is a secondary build based on chenyme/grok2api. Community discussions and support are linked via Linux.do.
Licensing & Compatibility
The project is released under the MIT license, permitting commercial use and integration into closed-source applications without significant restrictions.
Limitations & Caveats
The project is explicitly stated for "learning and research exchange only." The anti-ban deployment has specific server virtualization requirements (NET_ADMIN, SYS_MODULE), excluding OpenVZ/LXC. Users may encounter Cloudflare challenges if not utilizing the anti-ban setup or proper proxy configurations.
18 hours ago
Inactive