一、获取专属 API 链接二、API 调用方法总结 https://bibigpt.co/api/open/[apiToken]问答 https://bibigpt.co/api/open/[apiToken]/chat字幕 https://bibigpt.co/api/open/[apiToken]/subtitle文件 https://bibigpt.co/api/open/[apiToken]AI 文案改写 https://bibigpt.co/api/open/[apiToken]/express三、API 接口参数(目前仅支持「总结」API)3.1 可选配置参数 promptConfig3.2 limitation 限制条件四、使用案例4.1 百度搜索4.2 微信助理4.3 移动端 iOS 快捷指令4.4 浏览器插件4.5 联动笔记软件
一、获取专属 API 链接
请在登录后,查看 https://bibigpt.co/user/integration 页面,获取专属 API 链接🔗
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F1e724818-2aab-40c8-94dd-07063c3322aa%2FUntitled.png?table=block&id=5161345b-01d4-47cf-8678-4ca54ebf3f09&cache=v2)
二、API 调用方法
总结 https://bibigpt.co/api/open/[apiToken]
(支持 GET 和 POST 两种请求方式)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F861e9ae3-7720-4b55-8ca9-92fb42e015ca%2FUntitled.png?table=block&id=61e42223-840e-46f8-a064-9b47488a248d&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fcf16f5a9-d952-47c1-b883-9f41770112c4%2FUntitled.png?table=block&id=49cb6748-5210-4a35-9948-ea480e1c436a&cache=v2)
问答 https://bibigpt.co/api/open/[apiToken]/chat
interface ChatContentParams { url: string question: string # tuple for each [['Q1', 'A1'], ['Q2', 'A2']] history?: [string, string][] language?: string }
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F625e6654-8aea-4973-be43-a01eea08f96a%2FUntitled.png?table=block&id=f1e9f96f-bb49-4c55-a77a-965cdc250c07&cache=v2)
除了
answer
以外,还可以设置 includeDetail
参数,选择是否返回跟答案有关的 sourceDocuments
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fec15b56d-3944-453f-a345-92c1ead05e01%2FUntitled.png?table=block&id=a0110bfe-7fde-4b2a-b770-888532ebca8c&cache=v2)
如果需要连续提问的话,记得把上一次的 QA 问题和答案作为 history 上下文,从而提高下一次回答的准确性和连贯度(当然,这样所消耗的 token 时长也会加倍)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F9fcac5b7-e744-41fa-bd02-5d18dfb08f9d%2FUntitled.png?table=block&id=dbd7eed5-2be4-4dc4-8d9d-47d5a7d3d8e2&cache=v2)
字幕 https://bibigpt.co/api/open/[apiToken]/subtitle
相比于总结接口,由于少了请求 LLM 的时间,所以会快很多。
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F9985b3c0-67f0-410f-aa6b-310138002200%2FUntitled.png?table=block&id=ed56f5cc-62ac-420f-8cc5-428b2eaef5eb&cache=v2)
文件 https://bibigpt.co/api/open/[apiToken]
BibiGPT API 支持自定义的音视频文件地址,给 API 一个文件下载链接就好,比如以下的 https://a.jimmylv.cn/assets/music.mp3 (注意URL 路径以
.mp3
结尾)目前支持的类型包括
mp3|mp4|m4a|m4s|wav|webm|mpga|aac|ogg|oga|flac|alac|wma|avi|mkv|mov|flv|3gp|mpeg|ts|ogv|vob
,如果发现有还不支持的格式可以联系我!![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F3ed844bc-cee2-4a77-9caf-36523acc8c93%2FUntitled.png?table=block&id=016d9150-3706-471f-aa17-6ebb162dd5a0&cache=v2)
AI 文案改写 https://bibigpt.co/api/open/[apiToken]/express
受限于长文本上下文,Coming soon. BibiGPT.co 网页版可先行体验效果。
三、API 接口参数(目前仅支持「总结」API)
3.1 可选配置参数 promptConfig
1、promptConfig 只支持 POST 请求,作为 body 参数
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fca8856cb-e894-4000-80ce-b308d9141d3e%2FUntitled.png?table=block&id=3e4d6aec-52b5-4e0d-bf44-9982bc11ed86&cache=v2)
2、promptConfig 不填时的默认参数,可根据需求自行修改
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fcee3b214-632a-42f3-8108-3088aad161ac%2FUntitled.png?table=block&id=f4e75ce7-87a5-4517-a8db-627345ccfae2&cache=v2)
{ "showEmoji": true, "showTimestamp": false, "outlineLevel": 1, "sentenceNumber": 5, "detailLevel": 700, "outputLanguage": "zh-CN" }
注意:
detailLevel
对应「句子长短」,对应关系为 50,即 700/50=14(Web页面显示的数值)另外, 关于「输出语言」的对应关系为:
{ English: 'en-US', 中文: 'zh-CN', 繁體中文: 'zh-TW', 日本語: 'ja-JP', Italiano: 'it-IT', Deutsch: 'de-DE', Español: 'es-ES', Français: 'fr-FR', Nederlands: 'nl-NL', 한국어: 'ko-KR', ភាសាខ្មែរ: 'km-KH', हिंदी: 'hi-IN', }
3、promptConfig 中有一个特殊参数:
isRefresh
,当它有值并为 true
时,才会忽略缓存举例,这是一个「不输出emoji表情符号,显示时间戳,大纲层级为2,句子个数为3,句子长短为10,输出语言为英文,且强行刷新缓存」的promptConfig:
{ "showEmoji": false, "showTimestamp": true, "outlineLevel": 2, "sentenceNumber": 3, "detailLevel": 500, "outputLanguage": "en-US", "isRefresh": true }
3.2 limitation 限制条件
作为 API 的 limitation 字段可以设置
maxDuration
最大时长,然后如果后台检测 url 所对应的音视频时长超过了maxDuration ,就返回 422 error 错误状态码{ "url": "https://www.bilibili.com/video/BV1Sk4y1x7r2", "includeDetail": true, "limitation": { "maxDuration": 600 } }
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F59d02548-afc3-40a4-9c4f-6006ec8254e6%2FUntitled.png?table=block&id=bb2d9020-3446-4154-b2bc-74202bf40d3b&cache=v2)
四、使用案例
4.1 百度搜索
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fefcc1fcc-178f-4f95-bf76-05d93abedce9%2FUntitled.png?table=block&id=51ffbf1d-2508-4300-a2d1-9107056e55a1&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F6fda8841-ab55-4437-9333-cae5fadee8b1%2FUntitled.png?table=block&id=070855ea-77e9-4c37-9941-e7a9b6f4defb&cache=v2)
4.2 微信助理
新增视频、文章、播客总结插件,已更新到V0.0.3
Updated Sep 24, 2023
4.3 移动端 iOS 快捷指令
【AI 视频笔记】BibiGPT 开放API & IFTTT 无限想象力
4.4 浏览器插件
4.5 联动笔记软件
语音输入 → Roam Research → AI 改写 → AI 回顾
通过 telegroam 发送语音,然后用BibiGPT的API总结成文本,一键保存到Roam Research
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fca18ff3e-69f5-4419-8adf-ca10c808b7b5%2FUntitled.png?table=block&id=25a612f2-ba29-458f-ad15-6e9cfa35b18c&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2F0cf80170-0417-4a0d-8038-7725016e1f1d%2FUntitled.png?table=block&id=52436fa9-f8c2-42af-b303-58e2ed3cc956&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F63e5ea65-32b3-433d-a7a5-59ca1196fc85%2Fc99daaf5-61d4-471c-9d3a-830caad303fe%2FUntitled.png?table=block&id=a9be7aaa-686f-428c-9d8b-92c3ec161b7d&cache=v2)
详细文档(完善中):https://aitodo.co/docs/bibigpt-api