mirror of
https://github.com/LLM-Red-Team/kimi-free-api.git
synced 2025-10-15 14:50:37 +00:00
Compare commits
17 Commits
0.0.25
...
0.0.27-fix
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cbf215d8a8 | ||
![]() |
7c3bc3c0d8 | ||
![]() |
ae8e8316e4 | ||
![]() |
e1b7e55e70 | ||
![]() |
e1710ee95a | ||
![]() |
d14d062078 | ||
![]() |
1a3327cc8d | ||
![]() |
cfec318bd0 | ||
![]() |
1d18ac3f6b | ||
![]() |
b52e84bda0 | ||
![]() |
ee7cb9fdff | ||
![]() |
a12a967202 | ||
![]() |
bff5623f73 | ||
![]() |
2d2454b65b | ||
![]() |
4642939835 | ||
![]() |
87593a270a | ||
![]() |
ce89c29b05 |
36
README.md
36
README.md
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
与ChatGPT接口完全兼容。
|
与ChatGPT接口完全兼容。
|
||||||
|
|
||||||
还有以下四个free-api欢迎关注:
|
还有以下五个free-api欢迎关注:
|
||||||
|
|
||||||
阶跃星辰 (跃问StepChat) 接口转API [step-free-api](https://github.com/LLM-Red-Team/step-free-api)
|
阶跃星辰 (跃问StepChat) 接口转API [step-free-api](https://github.com/LLM-Red-Team/step-free-api)
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
ZhipuAI (智谱清言) 接口转API [glm-free-api](https://github.com/LLM-Red-Team/glm-free-api)
|
ZhipuAI (智谱清言) 接口转API [glm-free-api](https://github.com/LLM-Red-Team/glm-free-api)
|
||||||
|
|
||||||
|
秘塔AI (metaso) 接口转API [metaso-free-api](https://github.com/LLM-Red-Team/metaso-free-api)
|
||||||
|
|
||||||
聆心智能 (Emohaa) 接口转API [emohaa-free-api](https://github.com/LLM-Red-Team/emohaa-free-api)
|
聆心智能 (Emohaa) 接口转API [emohaa-free-api](https://github.com/LLM-Red-Team/emohaa-free-api)
|
||||||
|
|
||||||
## 目录
|
## 目录
|
||||||
@@ -34,6 +36,7 @@ ZhipuAI (智谱清言) 接口转API [glm-free-api](https://github.com/LLM-Red-Te
|
|||||||
* [多账号接入](#多账号接入)
|
* [多账号接入](#多账号接入)
|
||||||
* [Docker部署](#Docker部署)
|
* [Docker部署](#Docker部署)
|
||||||
* [Docker-compose部署](#Docker-compose部署)
|
* [Docker-compose部署](#Docker-compose部署)
|
||||||
|
* [Render部署](#Render部署)
|
||||||
* [Vercel部署](#Vercel部署)
|
* [Vercel部署](#Vercel部署)
|
||||||
* [原生部署](#原生部署)
|
* [原生部署](#原生部署)
|
||||||
* [接口列表](#接口列表)
|
* [接口列表](#接口列表)
|
||||||
@@ -150,13 +153,38 @@ services:
|
|||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Render部署
|
||||||
|
|
||||||
|
**注意:部分部署区域可能无法连接kimi,如容器日志出现请求超时或无法连接(新加坡实测不可用)请切换其他区域部署!**
|
||||||
|
**注意:免费账户的容器实例将在一段时间不活动时自动停止运行,这会导致下次请求时遇到50秒或更长的延迟,建议查看[Render容器保活](https://github.com/LLM-Red-Team/free-api-hub/#Render%E5%AE%B9%E5%99%A8%E4%BF%9D%E6%B4%BB)**
|
||||||
|
|
||||||
|
1. fork本项目到你的github账号下。
|
||||||
|
|
||||||
|
2. 访问 [Render](https://dashboard.render.com/) 并登录你的github账号。
|
||||||
|
|
||||||
|
3. 构建你的 Web Service(New+ -> Build and deploy from a Git repository -> Connect你fork的项目 -> 选择部署区域 -> 选择实例类型为Free -> Create Web Service)。
|
||||||
|
|
||||||
|
4. 等待构建完成后,复制分配的域名并拼接URL访问即可。
|
||||||
|
|
||||||
### Vercel部署
|
### Vercel部署
|
||||||
|
|
||||||
**注意:Vercel免费账户的请求响应超时时间为10秒,但接口响应通常较久,可能会遇到Vercel返回的504超时错误**
|
**注意:Vercel免费账户的请求响应超时时间为10秒,但接口响应通常较久,可能会遇到Vercel返回的504超时错误!**
|
||||||
|
|
||||||
点击按钮快速部署:
|
请先确保安装了Node.js环境。
|
||||||
|
|
||||||
[](https://vercel.com/import/project?template=https://github.com/LLM-Red-Team/kimi-free-api)
|
```shell
|
||||||
|
npm i -g vercel --registry http://registry.npmmirror.com
|
||||||
|
vercel login
|
||||||
|
git clone https://github.com/LLM-Red-Team/kimi-free-api
|
||||||
|
cd kimi-free-api
|
||||||
|
vercel --prod
|
||||||
|
```
|
||||||
|
|
||||||
|
### Zeabur部署
|
||||||
|
|
||||||
|
**注意:免费账户的容器实例可能无法稳定运行**
|
||||||
|
|
||||||
|
[](https://zeabur.com/templates/GRFYBP)
|
||||||
|
|
||||||
## 原生部署
|
## 原生部署
|
||||||
|
|
||||||
|
@@ -17,6 +17,8 @@ Ali Tongyi (Qwen) API to API [qwen-free-api](https://github.com/LLM-Red-Team/qwe
|
|||||||
|
|
||||||
ZhipuAI (Wisdom Map Clear Words) API to API [glm-free-api](https://github.com/LLM-Red-Team/glm-free-api)
|
ZhipuAI (Wisdom Map Clear Words) API to API [glm-free-api](https://github.com/LLM-Red-Team/glm-free-api)
|
||||||
|
|
||||||
|
MetaAI (metaso) 接口转API [metaso-free-api](https://github.com/LLM-Red-Team/metaso-free-api)
|
||||||
|
|
||||||
Listening Intelligence (Emohaa) API to API [emohaa-free-api](https://github.com/LLM-Red-Team/emohaa-free-api)
|
Listening Intelligence (Emohaa) API to API [emohaa-free-api](https://github.com/LLM-Red-Team/emohaa-free-api)
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
@@ -191,6 +193,10 @@ Out of service
|
|||||||
pm2 stop kimi-free-api
|
pm2 stop kimi-free-api
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Zeabur Deployment
|
||||||
|
|
||||||
|
[](https://zeabur.com/templates/GRFYBP)
|
||||||
|
|
||||||
## interface list
|
## interface list
|
||||||
|
|
||||||
Currently, the `/v1/chat/completions` interface compatible with openai is supported. You can use the client access interface compatible with openai or other clients, or use online services such as [dify](https://dify.ai/) Access and use.
|
Currently, the `/v1/chat/completions` interface compatible with openai is supported. You can use the client access interface compatible with openai or other clients, or use online services such as [dify](https://dify.ai/) Access and use.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "kimi-free-api",
|
"name": "kimi-free-api",
|
||||||
"version": "0.0.25",
|
"version": "0.0.27",
|
||||||
"description": "Kimi Free API Server",
|
"description": "Kimi Free API Server",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@@ -392,7 +392,7 @@ function messagesPrepare(messages: any[]) {
|
|||||||
return _content + `${message.role || "user"}:${v["text"] || ""}\n`;
|
return _content + `${message.role || "user"}:${v["text"] || ""}\n`;
|
||||||
}, content);
|
}, content);
|
||||||
}
|
}
|
||||||
return content += `${message.role || 'user'}:${wrapUrlsToTags(message.content)}\n`;
|
return content += `${message.role || 'user'}:${message.role == 'user' ? wrapUrlsToTags(message.content) : message.content}\n`;
|
||||||
}, '');
|
}, '');
|
||||||
logger.info("\n对话合并:\n" + content);
|
logger.info("\n对话合并:\n" + content);
|
||||||
return [
|
return [
|
||||||
@@ -610,7 +610,7 @@ async function receiveStream(model: string, convId: string, stream: any) {
|
|||||||
}
|
}
|
||||||
// 处理联网搜索
|
// 处理联网搜索
|
||||||
else if (!silentSearch && result.event == 'search_plus' && result.msg && result.msg.type == 'get_res')
|
else if (!silentSearch && result.event == 'search_plus' && result.msg && result.msg.type == 'get_res')
|
||||||
refContent += `${result.msg.title}(${result.msg.url})\n`;
|
refContent += `${result.msg.title} - ${result.msg.url}\n`;
|
||||||
// else
|
// else
|
||||||
// logger.warn(result.event, result);
|
// logger.warn(result.event, result);
|
||||||
}
|
}
|
||||||
@@ -707,7 +707,7 @@ function createTransStream(model: string, convId: string, stream: any, endCallba
|
|||||||
choices: [
|
choices: [
|
||||||
{
|
{
|
||||||
index: 0, delta: {
|
index: 0, delta: {
|
||||||
content: `检索 ${result.msg.title}(${result.msg.url}) ...\n`
|
content: `检索 ${result.msg.title} - ${result.msg.url} ...\n`
|
||||||
}, finish_reason: null
|
}, finish_reason: null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user