chenyme/grok2api
#56 this week
面向 Grok Build、Grok Web 与 Grok Console 的多账号 API 网关
6.0K stars
2.0K forks
6.0K GitHub watchers
Updated 7/16/2026
Backblaze Generative Media Hackathon
Build the next generation of AI media apps with Genblaze, stored on Backblaze B2. $10,000 in prizes.
Loading star history...
Use Cases & Benefits
- Transforms Grok Web capabilities into an OpenAI-compatible API using FastAPI for chat, image, and video generation.
- Provides seamless integration of Grok models with OpenAI API standards, enabling unified access and automatic load balancing.
- Use for building AI chatbots that support multi-modal conversations including text, images, and video generation.
- Use for deploying scalable Grok API gateways with token management and concurrency control in production environments.
- Use for research and development of AI applications requiring OpenAI-compatible endpoints with advanced Grok model features.
About grok2api
Grok2API
中文 | English
[!NOTE] 本项目仅供学习与研究,使用者必须在遵循 Grok 的 使用条款 以及 法律法规 的情况下使用,不得用于非法用途。
基于 FastAPI 重构的 Grok2API,全面适配最新 Web 调用格式,支持流/非流式对话、图像生成/编辑、深度思考,号池并发与自动负载均衡一体化。
使用说明
如何启动
- 本地开发
uv sync
uv run main.py
- 项目部署
git clone https://github.com/chenyme/grok2api
docker compose up -d
管理面板
访问地址:http://<host>:8000/admin
默认登录密码:grok2api(对应配置项 app.app_key,建议修改)。
功能说明:
- Token 管理:导入/添加/删除 Token,查看状态和配额