一 New API介绍
New API是AI模型接口管理与分发系统,支持将多种大模型转为OpenAI格式调用、支持Midjourney Proxy、Suno、Rerank,兼容易支付协议,仅供个人或者企业内部管理与分发渠道使用,请勿用于商业用途,本项目基于One API二次开发。
二 安装New API
GitHub地址:https://github.com/Calcium-Ion/new-api
基于Doker安装:
# 使用 SQLite 的部署命令:docker run --name new-api -d --restart always -p 3000:3000 -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest# 使用 MySQL 的部署命令,在上面的基础上添加 `-e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi"`,请自行修改数据库连接参数。# 例如:docker run --name new-api -d --restart always -p 3000:3000 -e SQL_DSN="root:123456@tcp(localhost:3306)/oneapi" -e TZ=Asia/Shanghai -v /home/ubuntu/data/new-api:/data calciumion/new-api:latest部署成功图:
更新New-api:

三 GitHub Models
3.1 申请GitHub Models
GitHub Models 是GitHub最新推出的模型托管服务,提供免费的AI模型供开发者测试。
申请加入https://github.com/marketplace/models/waitlist
拥有模型:
申请成功后会收到一封邮件:
3.2New API 加载 Github Models
①登录New API后进入渠道添加Github Models:
②选择自定义渠道
③Base URL填写:https://models.inference.ai.azure.com/chat/completions
④填写模型
⑤填写Github token
Github Token地址:https://github.com/settings/tokens
⑥测试渠道是否正常
⑦生成令牌
⑧使用NextChat
其中New API的域名请通过Nginx进行转发:
四 英伟达Llama-3.1-Nemotron-70B-Instruct
今天,英伟达又开源了一个性能超级强大的模型 —— Llama-3.1-Nemotron-70B-Instruct,它击败了 OpenAI 的 GPT-4o 等闭源模型和 Anthropic 的 Claude-3.5 sonnet 等开源模型。
从命名来看,显然 Llama-3.1-Nemotron-70B-Instruct 是基于 Llama-3.1-70B 打造而成。
在多个基准测试中,它一举超越多个最先进的 AI 模型,包括 OpenAI 的 GPT-4、GPT-4 Turbo 以及 Anthropic 的 Claude 3.5 Sonnet 等 140 多个开闭源模型。并且仅次于 OpenAI 最新模型 o1。
业内人士评价:英伟达在 Llama 3.1 的基础上训练出不太大的模型,超越了 GPT-4o 和 Claude 3.5 Sonnet,简直是神来之笔。
4.1 通过CF创建企业邮箱
4.2 注册Nvidia
地址:https://build.nvidia.com/nvidia/llama-3_1-nemotron-70b-instruct
点击右上角的Request More:
缩小屏幕:
4.3 添加到New API
类型:自定义渠道 Base URL:https://integrate.api.nvidia.com/v1/chat/completions 模型:nvidia/llama-3.1-nemotron-70b-instruct
curl https://integrate.api.nvidia.com/v1/chat/completions \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC" \ -d '{ "model": "nvidia/llama-3.1-nemotron-70b-instruct", "messages": [{"role":"user","content":"Write a limerick about the wonders of GPU computing."}], "temperature": 0.5, "top_p": 1, "max_tokens": 1024, "stream": true }'
API-KEY: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(可以使用的!1000额度)
在NextChat-Web中添加自定义模型:nvidia/llama-3.1-nemotron-70b-instruct
可以看到一次消耗1积分:
五 Hugging face Qwen2.5 72B
5.1 CF创建应用程序
5.2 创建Hugging Face API
5.3 重新部署CF应用程序
代码源自:感谢分享:https://linux.do/t/topic/229833
//对接one-api/new-api使用const API_KEY = "sk-1234567890";
//你的hugging face api key去hugging face申请const HUGGINGFACE_API_KEY = "hf_xxxxxxxxxxx";
//目前发现的可用模型,请求时如模型不在该列表内,则使用你请求的模型const CUSTOMER_MODEL_MAP = { "qwen2.5-72b-instruct": "Qwen/Qwen2.5-72B-Instruct", "gemma2-2b-it": "google/gemma-2-2b-it", "gemma2-27b-it": "google/gemma-2-27b-it", "llama-3-8b-instruct": "meta-llama/Meta-Llama-3-8B-Instruct", "llama-3.2-1b-instruct": "meta-llama/Llama-3.2-1B-Instruct", "llama-3.2-3b-instruct": "meta-llama/Llama-3.2-3B-Instruct", "phi-3.5": "microsoft/Phi-3.5-mini-instruct"};
async function handleRequest(request) { try { if (request.method === "OPTIONS") { return getResponse("", 204); }
const authHeader = request.headers.get("Authorization"); if (!authHeader || !authHeader.startsWith("Bearer ") || authHeader.split(" ")[1] !== API_KEY) { return getResponse("Unauthorized", 401); }
if (request.url.endsWith("/v1/models")) { const arrs = []; Object.keys(CUSTOMER_MODEL_MAP).map(element => arrs.push({ id: element, object: "model" })) const response = { data: arrs, success: true };
return getResponse(JSON.stringify(response), 200); }
if (request.method !== "POST") { return getResponse("Only POST requests are allowed", 405); }
if (!request.url.endsWith("/v1/chat/completions")) { return getResponse("Not Found", 404); }
const data = await request.json(); const messages = data.messages || []; const model = CUSTOMER_MODEL_MAP[data.model] || data.model; const temperature = data.temperature || 0.7; const max_tokens = data.max_tokens || 8196; const top_p = Math.min(Math.max(data.top_p || 0.9, 0.0001), 0.9999); const stream = data.stream || false;
const requestBody = { model: model, stream: stream, temperature: temperature, max_tokens: max_tokens, top_p: top_p, messages: messages };
const apiUrl = `https://api-inference.huggingface.co/models/${model}/v1/chat/completions`; const response = await fetch(apiUrl, { method: 'POST', headers: { 'Authorization': `Bearer ${HUGGINGFACE_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify(requestBody) });
if (!response.ok) { const errorText = await response.text(); return getResponse(`Error from API: ${response.statusText} - ${errorText}`, response.status); }
const newResponse = new Response(response.body, { status: response.status, headers: { ...Object.fromEntries(response.headers), 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': '*', 'Access-Control-Allow-Headers': '*' } });
return newResponse; } catch (error) { return getResponse(JSON.stringify({ error: `处理请求失败: ${error.message}` }), 500); }}
function getResponse(resp, status) { return new Response(resp, { status: status, headers: { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "*", "Access-Control-Allow-Headers": "*" } });}
addEventListener('fetch', event => { event.respondWith(handleRequest(event.request))})查看调用地址:
获取模型列表:
5.4 ChatGPT-Next-Web使用Qwen2.5-72b-instruct
体验下来还是qwen2.5-72b-instruct更适合我们使用~
六 X-AI
6.1 申请X-AI
注册地址:https://accounts.x.ai/sign-up?redirect=cloud-console
6.2 使用X-AI
https://api.x.ai/v1/chat/completions
grok-beta
xai-ZsT5i2VIs1z6Rjvw7nuf16WO9Rdnl9hhUJ1VuKnApSpKUc1p91DGNebRGvpNLvIp55sPFaN5WkCceXM9
七 Gemini
7.1 申请Gemini
7.2 使用Gemini
gemini-1.5-pro-002,gemini-1.5-pro,gemini-1.5-flash,gemini-1.5-flash-002,gemini-flash-8b
https://gemini-proxy.keyikai.me
八 genspark
Genspark是由Mainfunc Inc.创建的AI助手。包含大型语言模型,能够处理各种任务,包括创意写作、编码、分析、教学和一般对话。
8.1 申请genspark
地址:https://www.genspark.ai/invite?invite_code=ZjU1M2E4YjNMZWMyOEw5NGU0TGVhY2JMZTU5MDFmZTY5MzY1
接码平台:https://sms-activate.org/
可刷20个月使用权限:
8.2 使用genspark
部署genspark2api,部署完成后可加入New API
https://github.com/deanxv/genspark2api
九 DeepSeek
DeepSeek-V3 多项评测成绩超越了 Qwen2.5-72B 和 Llama-3.1-405B 等其他开源模型,并在性能上和世界顶尖的闭源模型 GPT-4o 以及 Claude-3.5-Sonnet 不分伯仲。
9.1 DeepSeek注册
注册地址:https://www.deepseek.com/
9.2 DeepSeek使用
创建API Keys:
New API创建DeepSeek后添加密钥即可:
十 硅基流动
10.1 硅基流动注册
注册地址:https://cloud.siliconflow.cn/i/d40omfvY
10.2 硅基流动使用
类型选择SiliconCloud,模型获取模型列表,添加密钥即可使用~
10.3 刷硅基流动API
找到免费接码平台:
如果出现以下情况:
请使用指纹浏览器:https://github.com/Virtual-Browser/VirtualBrowser
拉人头的API Key不要扔。多个14元也可以用很久,https://cherry-ai.com/
送一些14元的API:
sk-szhaoobqvkbupemcgdduwkjhnhpuqbsobpevsyutyrrtjwaisk-areclqfwlogjoxpxcswqufgavciessxbzaymtsmizzptlueusk-enyquynazjeodoetgjfyashsnfwtdscwwjmhsqolyslotifpsk-tgvjzrfpynjyulmmvfrffdbmxnffpgczovzijcaafbzmampesk-zamlisxvwvsuhsbnitrwbjamvhcbrivulvvfmdcnptwttszask-hkjehocdrdhbcwmygvuoqhrpobyehuzjzmtiqmqcjmbyhxfrsk-yjwatpmjxktgqrfmoafrrlbfcjtxohpwozyuhzhxlziewktnsk-jprlohnrjqblpzyenbvtjtwbhbwpokngzuosazqbqzkxuovtsk-flwwllmbgwcfwdwafjveliwyxemvzqkblazxkjmwyljchpkesk-ccromdofalqjzarfnuvdjwpjnhueijlrlrykqszeprjsjwhnsk-gyvissagxdoyvohkjetvvilvdwqqvajjgzppmhjvwrzethdrsk-bsmobjzcsjiswqulehydsonamjgwbdvduzkucugictmjnvrxsk-wcleesounbogvrokxjjzswtiicsltymtfjnrtzqlubzomhzzsk-iygqluhnchvvmuoerbjsqymgswgjyitvdzhuekpstsnzgvvgsk-egphrebomznvaplhslhkhbfczmvsjpfkifhvjqtblajbooto