by su-kaka
将 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口
# Add to your Claude Code skills
git clone https://github.com/su-kaka/agy2apiGuides for using api integration skills like agy2api.
Last scanned: 10/23/2026
{
"issues": [
{
"file": "README.md",
"line": 260,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
}
],
"status": "PASSED",
"scannedAt": "2026-10-23T09:07:11.496Z",
"npmAuditRan": true,
"pipAuditRan": false,
"promptInjectionRan": true
}See how agy2api compares with popular alternatives.
agy2api is an open-source api integration skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by su-kaka. 将 Antigravity 转换为 OpenAI 、GEMINI 和 Claude API 接口. It has 5,268 GitHub stars.
Yes. agy2api passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/su-kaka/agy2api" and add it to your Claude Code skills directory (see the Installation section above).
agy2api is primarily written in Python. It is open-source under su-kaka on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other API Integration skills you can browse and compare side by side. Open the API Integration category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh agy2api against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
30 days in the Featured rail · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
将 Google Antigravity 转换为 OpenAI、Gemini 和 Claude API 兼容接口
⚠️ 重要变更:GeminiCLI 端点已被谷歌抛弃,本项目已完全移除 GeminiCLI 相关代码,仅保留 Antigravity 模式。
初始安装
curl -o termux-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/termux-install.sh" && chmod +x termux-install.sh && ./termux-install.sh
重启服务
cd agy2api
bash termux-start.sh
初始安装
iex (iwr "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.ps1" -UseBasicParsing).Content
重启服务
双击执行 start.bat
初始安装
curl -o install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.sh
重启服务
cd agy2api
bash start.sh
初始安装
curl -o darwin-install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/darwin-install.sh" && chmod +x darwin-install.sh && ./darwin-install.sh
重启服务
cd agy2api
bash start.sh
Docker 运行命令
docker run -d --name agy2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds ghcr.io/su-kaka/agy2api:latest
Docker Compose 运行命令
docker-compose.yml,或参考以下内容:
version: '3.8'
services:
agy2api:
image: ghcr.io/su-kaka/agy2api:latest
container_name: agy2api
restart: unless-stopped
network_mode: host
environment:
# 密码配置(分离密码)
- API_PASSWORD=your_api_password
- PANEL_PASSWORD=your_panel_password
- PORT=7861
volumes:
- ./data/creds:/app/creds
docker-compose up -d
Antigravity 多端点多格式支持
/v1/chat/completions 和 /v1/models/v1/models/{model}:generateContent 和 streamGenerateContent/v1/messages基于 React + Vite + Tailwind 编译的现代化前端界面:
模型列表从 Antigravity API 动态获取,支持所有 Antigravity 模型:
claude-sonnet-4-5、claude-opus-4-5 等gemini-2.5-flash、gemini-3-flash-preview 等特殊功能变体:
抗截断/ 前缀
抗截断/gemini-2.5-pro-2k、-4k)和比例(-16x9、-9x16 等)后缀http://127.0.0.1:7861(默认端口,可通过 PORT 环境变量修改)pwd,可通过环境变量修改)OpenAI 兼容客户端:
http://127.0.0.1:7861/v1pwd(默认值,可通过 API_PASSWORD 环境变量修改)Gemini 原生客户端:
http://127.0.0.1:7861Authorization: Bearer 密钥、x-goog-api-key: 密钥 或 URL 参数 ?key=密钥Claude 客户端:
http://127.0.0.1:7861/v1/messagesx-api-key: 密钥 或 Authorization: Bearer 密钥| 后端 | 说明 | 启用方式 |
|---|---|---|
| SQLite(默认) | 本地文件存储,开箱即用 | 无需配置,数据存储在 creds/credentials.db |
| PostgreSQL | 云端分布式存储,多实例部署 | 设置 POSTGRESQL_URI 环境变量 |
凭证以邮箱(email)为唯一键存储,字段为结构化数据库列(不再使用 JSON blob):
email、access_token、refresh_token、client_id、client_secret、project_id、expiry、tier
凭证导入/导出使用规范 JSON 格式:{"refresh_token": "...", "email": "...", "tier": "...", "project_id": "..."}(仅 refresh_token 必填,其余字段可自动获取)。
基础配置
PORT: 服务端口(默认:7861)HOST: 服务器监听地址(默认:0.0.0.0)密码配置
API_PASSWORD: 聊天 API 访问密码(默认:pwd)PANEL_PASSWORD: 控制面板访问密码(默认:pwd)存储配置
CREDENTIALS_DIR: 凭证数据库目录(默认:./creds)POSTGRESQL_URI: PostgreSQL 连接字符串(设置后启用 PostgreSQL 模式)网络和代理配置
PROXY: 代理地址(支持 http://、https://、socks5://、socks5h://,可带账号密码 user:pass@host:port)OAUTH_PROXY_URL: OAuth 认证代理端点GOOGLEAPIS_PROXY_URL: Google APIs 代理端点ANTIGRAVITY_API_URL: Antigravity API 端点性能和稳定性配置
RETRY_429_ENABLED: 启用错误自动重试(默认:true)RETRY_429_MAX_RETRIES: 最大重试次数(默认:5)RETRY_429_INTERVAL: 重试间隔,秒(默认:1)ANTI_TRUNCATION_MAX_ATTEMPTS: 抗截断最大重试次数(默认:3)自动化配置
AUTO_BAN: 启用凭证自动封禁(默认:false)AUTO_BAN_ERROR_CODES: 触发自动封禁的错误码(默认:403)响应行为配置
RETURN_THOUGHTS_TO_FRONTEND: 返回思维链到前端(默认:true)ANTIGRAVITY_SWITCH_CREDENTIAL: 重试时切换凭证(默认:false)敏感词过滤配置
SENSITIVE_WORDS_ENABLED: 启用敏感词过滤(默认:true)SENSITIVE_WORDS: 敏感词列表,逗号或换行分隔(默认:空)。命中后整词替换为空,不区分大小写,支持中文,面板保存后立即生效请求日志配置
USAGE_LOG_ENABLED: 启用请求日志(默认:true)。记录每次 API 请求(模型、凭证、token 用量、耗时、状态)到数据库USAGE_LOG_RETENTION_DAYS: 日志保留天数(默认:30,0 = 永久保留)。启动时自动清理过期日志日志配置
LOG_LEVEL: 日志级别(DEBUG/INFO/WARNING/ERROR,默认:INFO)ENABLE_LOG: 完全静默,不打印任何日志(设为 0 启用静默,默认:1)curl -X POST "http://127.0.0.1:7861/v1/chat/completions" \
-H "Authorization: Bearer your_api_password" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"messages": [
{"role": "user", "content": "Hello"}
],
"stream": true
}'
curl -X POST "http://127.0.0.1:7861/v1/models/gemini-2.5-flash:generateContent?key=your_api_password" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{"role": "user", "parts": [{"text": "Hello"}]}
]
}'
curl -X POST "http://127.0.0.1:7861/v1/messages" \
-H "x-api-key: your_api_password" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-4-5",
"max_tokens": 1024,
"messages": [
{"role": "user", "content": "Hello, Claude!"}
]
}'
from io import BytesIO
from PIL import Image
from google.genai import Client
from google.genai.types import HttpOptions
from google.genai import types
client = Client(
api_key="pwd",
http_options=HttpOptions(base_url="http://127.0.0.1:7861"),
)
prompt = "画一只猫"
response = client.models.generate_content(
model="gemini-3.1-flash-image",
contents=[prompt],
config=types.GenerateContentConfig(
image_config=types.ImageConfig(
aspect_ratio="16:9",
)
)
)
for part in response.candidates[0].content.parts:
if part.text is not None:
print(part.text)
elif part.inline_data is not None:
image = Image.open(BytesIO(part.inline_data.data))
image.save("generated_image.png")
控制面板前端源码位于 frontend/ 目录(React + Vite + Tailwind CSS):
cd frontend
npm install
npm run dev # 开发模式,端口 3000,代理后端 API
npm run build # 构建到 dist/(生产模式使用)
后端直接托管 dist/ 下编译后的静态文件,无需 Node.js 运行时。
欢迎加入 QQ 群交流讨论!
QQ 群号:1083250744

本项目仅供学习研究使用,禁止商业用途和倒卖。
本项目使用 CNC-1.0 许可证(反商业许可证)。