能力标签
新一代AI工具
🛠
AI工具

新一代AI工具

基于 Go · 开源免费,本地部署,数据完全自主可控
英文名:new-api
⭐ 35.8k Stars 🍴 8.1k Forks 💻 Go 📄 AGPL-3.0 🏷 AI 8.5分
8.5AI 综合评分
ai-gatewayclaudedeepseekgemini
✦ AI Skill Hub 推荐

新一代AI工具 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 35.8k 颗 Star,综合评分 8.5 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

新一代AI工具 是一款基于 Go 的开源工具,在 GitHub 上收获 36k+ Star,是ai-gateway、claude、deepseek、gemini领域中的优质开源项目。开源工具的最大优势在于代码完全透明,你可以审计每一行代码的安全性,也可以根据自身需求进行二次开发和定制。

**为什么要使用开源工具而非商业 SaaS?**
对于个人开发者和有隐私需求的用户,本地部署的开源工具意味着数据不离本机,不受第三方服务商的数据政策约束。同时,开源工具通常没有使用次数限制和月度费用,一次安装即可长期使用,对于高频使用场景的总拥有成本(TCO)远低于订阅制商业工具。

**安装与环境准备**
新一代AI工具 依赖 Go 运行环境。建议通过 pyenv(Python)或 nvm(Node.js)管理 Go 版本,避免全局环境污染。对于新手用户,推荐先创建虚拟环境(python -m venv venv && source venv/bin/activate),再安装依赖,这样即使出现问题也可以随时删除虚拟环境重新开始,不影响系统稳定性。

**社区与维护**
GitHub Issue 和 Discussion 是获取帮助的最快渠道。在提问前建议先检查 Closed Issues(已关闭的问题),大多数常见问题都已有解答。遇到 Bug 时,提供 pip list 的输出、完整错误堆栈和最小可复现示例,能显著提高开发者响应速度。AI Skill Hub 将持续追踪 新一代AI工具 的版本更新,及时通知重要功能变化。

📋 工具概览

新一代AI工具 是一款基于 Go 开发的开源工具,专注于 ai-gateway、claude、deepseek 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

GitHub Stars
⭐ 35.8k
开发语言
Go
支持平台
Windows / macOS / Linux(跨平台)
维护状态
活跃维护,更新频繁
开源协议
AGPL-3.0
AI 综合评分
8.5 分
工具类型
AI工具
Forks
8.1k

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

新一代AI工具 是一款基于 Go 开发的开源工具,专注于 ai-gateway、claude、deepseek 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。

📌 核心特色
  • 开源免费,支持本地部署,数据完全自主可控
  • 活跃的 GitHub 开源社区,持续迭代更新
  • 提供详细文档和使用示例,新手友好
  • 支持自定义配置,灵活适配不同使用环境
  • 可作为基础组件集成进现有技术栈或进行二次开发
🎯 主要使用场景
  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:go install(推荐)
go install github.com/QuantumNous/new-api@latest

# 方式二:从源码编译
git clone https://github.com/QuantumNous/new-api
cd new-api
go build -o new-api .

# 方式三:下载预编译二进制
# 访问 Releases 页面下载对应平台二进制文件
# https://github.com/QuantumNous/new-api/releases
📋 安装步骤说明
  1. 访问 GitHub 仓库页面
  2. 按照 README 文档完成依赖安装
  3. 根据系统环境完成初始化配置
  4. 参考官方示例或文档开始使用
  5. 遇到问题可在 GitHub Issues 中查找解答
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 查看帮助
new-api --help

# 基本运行
new-api [options] <input>

# 详细使用说明请查阅文档
# https://github.com/QuantumNous/new-api
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
# new-api 配置说明
# 查看配置选项
new-api --config-example > config.yml

# 常见配置项
# output_dir: ./output
# log_level: info
# workers: 4

# 环境变量(覆盖配置文件)
export NEW_API_CONFIG="/path/to/config.yml"
📑 README 深度解析 真实文档 完整度 81/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

简介

new-api

📝 Project Description

New API is a self-hosted AI gateway for applications, agents, and teams. Connect upstream model services, expose a consistent API to your clients, and manage routing, access, usage, and costs in one place.

Use it to share authorized model access across a team, switch providers without configuring every client again, or operate a private multi-model service with a web console. Upstreams include OpenAI, Anthropic, Google Gemini, Azure OpenAI, AWS Bedrock, Vertex AI, DeepSeek, Qwen, and other compatible services.

[!IMPORTANT] - This project is intended solely for lawful and authorized AI API gateway, organization-level authentication, multi-model management, usage analytics, cost accounting, and private deployment scenarios. - Users must lawfully obtain upstream API keys, accounts, model services, and interface permissions, and must comply with upstream terms of service and applicable laws and regulations. - Users should ensure their use complies with upstream terms of service and applicable laws and regulations. - When providing generative AI services to the public, users should comply with applicable regulatory requirements and fulfill all filing, licensing, content safety, real-name verification, log retention, tax, and upstream authorization obligations required by their jurisdiction.
[!WARNING] When operating this project as a public generative AI service or API resale service, users should first complete all required filing, licensing, content safety, real-name verification, log retention, tax, payment, and upstream authorization obligations.

---

<a id="screenshots"></a>

Capabilities

AreaWhat you can do
Model accessUse OpenAI Chat Completions, Responses, Anthropic Messages, and Gemini APIs; stream responses and use tools, reasoning, and multimodal inputs where supported
RoutingConfigure model mappings, channel priorities and weights, retries, channel affinity, and multiple upstream keys
Usage and costsManage quotas, subscriptions, usage logs, cache accounting, and expression-based pricing for different usage tiers
Access controlManage users, groups, fine-grained permissions, and API key restrictions; use OAuth/OIDC, passkeys, two-factor authentication, and login session management
Asynchronous tasksExtend image, video, and other task APIs with JavaScript plugins, including task status and output retrieval
Web consoleConfigure channels and models, inspect usage and audit logs, and try models in the playground; available in English, Simplified Chinese, Traditional Chinese, French, Japanese, Russian, and Vietnamese

Try locally with Docker

This starts a single instance with SQLite and binds it to localhost:

mkdir -p data
docker run --name new-api -d --restart unless-stopped \
  -p 127.0.0.1:3000:3000 \
  -e TZ=Asia/Shanghai \
  -v "$(pwd)/data:/data" \
  calciumion/new-api:latest

Open http://localhost:3000 and complete the setup wizard to create the administrator account. The data directory persists the SQLite database across container replacements.

Deployment

Docker Compose

The repository's Compose configuration starts New API + PostgreSQL + Redis by default. It also contains examples for MySQL and a separate ClickHouse log database.

git clone https://github.com/QuantumNous/new-api.git
cd new-api

Before starting, edit docker-compose.yml: replace the database and Redis example passwords in both the services and connection strings, and set a persistent random SESSION_SECRET (generate one with openssl rand -hex 32). For an HTTPS console, configure SESSION_COOKIE_SECURE=true and SESSION_COOKIE_TRUSTED_URL with its exact public HTTPS origin.

docker compose up -d
docker compose logs -f new-api

Quick start

Screenshots

Accounts, channels, plugin installation states, usage, prices, and costs shown below are simulated data. The marketplace displays the official plugin catalog. Click an image to view it at full size.

Usage dashboardPlugin marketplace
[![Usage dashboard with simulated requests, costs, and performance metrics](assets/screenshots/dashboard.en.jpg)](assets/screenshots/dashboard.en.jpg)[![Official plugin marketplace with simulated installation status](assets/screenshots/plugin-marketplace.en.jpg)](assets/screenshots/plugin-marketplace.en.jpg)
**Model square****Usage logs**
[![Model square with simulated model pricing and availability](assets/screenshots/models.en.jpg)](assets/screenshots/models.en.jpg)[![Usage logs with simulated tokens, costs, and response times](assets/screenshots/usage-logs.en.jpg)](assets/screenshots/usage-logs.en.jpg)

---

Storage and configuration

ComponentOptions
Main databaseSQLite, MySQL ≥ 5.7.8, or PostgreSQL ≥ 9.6
Separate log databaseConfigure with LOG_SQL_DSN; also supports ClickHouse
CacheOptional Redis plus in-memory caching; use shared Redis when application nodes need shared rate limits
Container platformsLinux amd64 / arm64
VariablePurpose
SQL_DSNMain database connection; unset uses SQLite
LOG_SQL_DSNOptional separate log database connection
REDIS_CONN_STRINGRedis connection string
SESSION_SECRETPersistent authentication secret; all nodes must use the same value
CRYPTO_SECRETDefaults to SESSION_SECRET; nodes sharing Redis must use the same effective value
SESSION_COOKIE_SECURESet to true for an HTTPS console; enables Secure refresh cookies and strict refresh/logout origin checks
SESSION_COOKIE_TRUSTED_URLRequired in Secure mode: comma-separated exact HTTPS origins, without paths or wildcards; leave unset for local HTTP
TRUSTED_PROXIESTrusted reverse-proxy IPs/CIDRs, or none; explicitly configure for your network

See the environment example, environment reference, and authentication and session guide for full configuration. Configure container variables in Compose's environment or env_file; copying .env.example alone does not inject variables into the container.

For production, put the console behind HTTPS and configure your reverse proxy for streaming and WebSocket upgrades. Persist and back up the database and mounted data. Multi-node deployments must share the main database and authentication secrets; separate Redis instances or in-memory rate limiters count limits independently per node. The session guide describes propagation behavior for each topology.

Pin an image version from Releases, review its upgrade notes, and back up before upgrading. The latest tag follows published builds and can change; migrations and compatibility must be assessed for your existing installation.

<a id="development"></a>

New API

An AI gateway for models, applications, and agents

<p align="center"> <a href="./README.zh_CN.md">简体中文</a> | <a href="./README.zh_TW.md">繁體中文</a> | <strong>English</strong> | <a href="./README.fr.md">Français</a> | <a href="./README.ja.md">日本語</a> </p>

<p align="center"> <a href="https://raw.githubusercontent.com/Calcium-Ion/new-api/main/LICENSE"> <img src="https://img.shields.io/github/license/Calcium-Ion/new-api?color=brightgreen" alt="license"> </a><a href="https://github.com/Calcium-Ion/new-api/releases/latest"> <img src="https://img.shields.io/github/v/release/Calcium-Ion/new-api?color=brightgreen&include_prereleases" alt="release"> </a><a href="https://hub.docker.com/r/CalciumIon/new-api"> <img src="https://img.shields.io/badge/docker-dockerHub-blue" alt="docker"> </a> <a href="https://atomgit.com/QuantumNous/new-api" target="_blank"> <img alt="AtomGit G-Star" src="https://atomgit.com/QuantumNous/new-api/star/badge.svg"/> </a> </p>

<p align="center"> <a href="https://trendshift.io/repositories/20180" target="_blank"> <img src="https://trendshift.io/api/badge/repositories/20180" alt="QuantumNous%2Fnew-api | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/> </a> <br> <a href="https://hellogithub.com/repository/QuantumNous/new-api" target="_blank"> <img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=539ac4217e69431684ad4a0bab768811&claim_uid=tbFPfKIDHpc4TzR" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /> </a> <a href="https://atomgit.com/QuantumNous/new-api" target="_blank"> <img alt="AtomGit G-Star" src="https://atomgit.com/QuantumNous/new-api/star/new_badge.svg" width="250" height="55" /> </a> </p>

<p align="center"> <a href="#screenshots">Screenshots</a> • <a href="#capabilities">Capabilities</a> • <a href="#quick-start">Quick start</a> • <a href="#deployment">Deployment</a> • <a href="#development">Development</a> • <a href="#documentation">Documentation</a> </p>

</div>

---

Protocols and endpoints

InterfaceCommon endpoints
OpenAI Chat / ResponsesPOST /v1/chat/completions, POST /v1/responses
Anthropic MessagesPOST /v1/messages
GeminiPOST /v1beta/models/{model}:generateContent, POST /v1beta/models/{model}:streamGenerateContent
Realtime / Responses WebSocketGET /v1/realtime, GET /v1/responses (WebSocket upgrade)
Images / audio/v1/images/generations, /v1/images/edits, /v1/audio/speech, /v1/audio/transcriptions, /v1/audio/translations
Embeddings / rerankPOST /v1/embeddings, POST /v1/rerank
Task pluginsPOST /v1/tasks/{pluginKey}, GET /v1/tasks/{taskId}, plus routes declared by each plugin

RelayKit provides request, response, and streaming conversion between the four text protocols. Available features depend on the channel, upstream model, and conversion path; protocol-specific tools and fields may not map exactly. WebSocket support also requires a compatible upstream and channel configuration.

This README describes the current source tree. Check the release notes for the version you deploy.

<a id="quick-start"></a>

💖 Thank you for using New API

If this project is helpful to you, welcome to give us a ⭐️ Star!

Official Documentation • Issue Feedback • Latest Release

<sub>Built with ❤️ by QuantumNous</sub>

</div>

Development and extensions

The backend uses Go and Gin. The web console uses React 19, TypeScript, Rsbuild, TanStack, and Tailwind CSS 4. Use Bun for frontend dependencies and scripts; see go.mod for the Go language baseline and Dockerfile for the container build toolchain.

Build the frontend before starting the backend, which embeds web/dist:

```bash

🇨🇳 中文文档镜像 AI 翻译 2026-06-11
英文原文章节由系统翻译为中文摘要,便于快速理解。完整原文见上方 "📑 README 深度解析"。
📌 简介

New API 是一个下一代 LLM 网关和 AI 资产管理系统,专为合法授权的 AI API 网关、组织级身份认证、多模型管理、使用分析、成本核算和私有部署场景设计。该项目要求用户合法获取上游 API 密钥、账户和模型服务权限,并遵守上游服务条款及适用法律法规。

⚡ 功能介绍

支持多种 API 格式,包括 OpenAI Responses、OpenAI Realtime API(含 Azure)、Claude Messages 和 Google Gemini 等。提供组织级按请求、按使用量和缓存命中的成本核算,支持 OpenAI、Azure、DeepSeek、Claude、Qwen 等模型的缓存计费统计。内置合法授权场景下的充值和配额分配功能(支持 EPay、Stripe),灵活的计费策略适用于内部管理或授权企业客户。

📋 环境依赖

本地数据库支持 SQLite(Docker 需挂载 `/data` 目录),远程数据库支持 MySQL ≥ 5.7.8 或 PostgreSQL ≥ 9.6。容器引擎需使用 Docker 或 Docker Compose。推荐使用最新 Docker 镜像 `calciumion/new-api:latest`。

🛠 安装步骤(Docker/pip/源码)

推荐使用 Docker Compose 部署。首先编辑 docker-compose.yml 配置文件(使用 `nano docker-compose.yml`),根据需求配置数据库连接、环境变量等参数,然后执行 Docker Compose 启动命令完成部署。详细安装步骤请参考官方安装文档。

🚀 使用教程

部署完成后,系统支持合法授权场景下的内部充值和配额分配(支持 EPay、Stripe 等支付方式)。提供组织级的成本核算功能,可按请求、使用量或缓存命中进行计费统计。支持多种 LLM 模型的灵活管理和计费策略配置,适用于内部管理或授权企业客户的使用场景。

⚙️ 配置说明(含 MCP / env)

关键环境变量包括:`SESSION_SECRET`(会话密钥,多机部署时必需)、`CRYPTO_SECRET`(加密密钥,Redis 使用时必需)、`SQL_DSN`(数据库连接字符串)、`REDIS_C`(Redis 配置)等。所有配置通过编辑 docker-compose.yml 文件进行管理,支持灵活的自定义配置以适应不同部署场景。

🔌 API 说明

New API 提供完整的 LLM 网关 API 接口,支持 OpenAI、Claude、Google Gemini 等多种模型的标准 API 调用。包括聊天补全、实时 API、消息创建等功能。详细的 API 文档和调用示例请参考官方 API 文档。

🎯 aiskill88 AI 点评 A 级 2026-05-28

高质量的AI工具,支持跨模型转换

📚 实用指南(长尾问题)
适合谁
  • 构建企业知识库 / RAG 检索应用的团队
最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal
部署方案
  • Docker:new-api 提供官方镜像,docker compose up 一键启动
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
new-api 中文教程new-api 安装报错怎么办new-api Docker 部署new-api 与同类工具对比new-api 最佳实践new-api 适合谁用

⚡ 核心功能

👥 适合谁
  • 构建企业知识库 / RAG 检索应用的团队
⭐ 最佳实践
  • 生产部署优先使用 Docker Compose 隔离依赖,并挂载 volume 持久化数据
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • 容器内无法访问宿主机 localhost — 使用 host.docker.internal

👥 适合人群

AI 技术爱好者研究人员和学生开发者和工程师技术创业者

🎯 使用场景

  • 本地部署运行,保护数据隐私,满足合规要求
  • 自定义集成到现有系统,扩展技术栈能力
  • 作为开源基础组件进行商业化二次开发

⚖️ 优点与不足

✅ 优点
  • +GitHub 35.8k Star,社区高度认可
  • +AI Skill Hub 精选推荐
  • +完全开源免费,无授权费用
  • +本地部署,数据完全自主可控
  • +开发者社区支持,遇问题可查可问
⚠️ 不足
  • −安装和初始配置可能需要一定技术基础
  • −功能完整性通常不如成熟商业产品
  • −技术支持主要依赖开源社区,响应速度不稳定
⚠️ 使用须知

该工具使用 AGPL-3.0 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

⚠️ AGPL 3.0 — 最严格的 Copyleft,网络服务端使用也需开源,SaaS 使用受限。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

new-api 是一款Go开发的AI辅助工具。开源AI工具:A unified AI model hub for aggregation & distribution. It supports cross-convert。⭐35.8k · Go 主要应用场景包括:AI模型聚合与分发。
💡 AI Skill Hub 点评

经综合评估,新一代AI工具 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

📚 深入学习 新一代AI工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 new-api
原始描述 开源AI工具:A unified AI model hub for aggregation & distribution. It supports cross-convert。⭐35.8k · Go
Topics ai-gatewayclaudedeepseekgemini
GitHub https://github.com/QuantumNous/new-api
License AGPL-3.0
语言 Go
🔗 原始来源
🐙 GitHub 仓库  https://github.com/QuantumNous/new-api 🌐 官方网站  https://www.newapi.ai

收录时间:2026-05-28 · 更新时间:2026-05-30 · License:AGPL-3.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →