GithubHelp home page GithubHelp logo

支持豆包系列大模型API about one-api HOT 17 CLOSED

klb3713 avatar klb3713 commented on June 23, 2024 14
支持豆包系列大模型API

from one-api.

Comments (17)

songquanpeng avatar songquanpeng commented on June 23, 2024 21

这个肯定会支持,我尽量近期抽空处理,希望能理解最近我个人时间不多

from one-api.

RexWzh avatar RexWzh commented on June 23, 2024 3

更新:提醒下刚点进来的朋友:没必要一直发 +1 ,避免给开发者的邮箱增加无意义的邮件。

需要+1的,给仓库点个star,在 Issue 顶部加个表情就行了

image

如果希望接收邮箱提醒可以点右边订阅

image

功能请求:增加一个允许用户提供完整链接的渠道,版本号用户自定义。

场景:

  1. 智谱,DeepSeek,豆包等渠道的默认代理地址不以 v1 结尾。

  2. OpenAI 的完整 API 地址是 https://api.openai.com/v1 来着,尾巴作为版本号。官方 SDK 也是读取环境变量 OPENAI_API_BESE ,然后拼接 URI 时不需要带 v1

from one-api.

lanyuer avatar lanyuer commented on June 23, 2024

+1

from one-api.

zsinba avatar zsinba commented on June 23, 2024

+1

from one-api.

webtechnic avatar webtechnic commented on June 23, 2024

+1

from one-api.

shengjidaguai avatar shengjidaguai commented on June 23, 2024

+1

from one-api.

TangSY avatar TangSY commented on June 23, 2024

+1

from one-api.

fishfree avatar fishfree commented on June 23, 2024

+1

from one-api.

lifei1102 avatar lifei1102 commented on June 23, 2024

+1,豆包降价后性价比超高,pro-32k 100万token 才8毛钱

from one-api.

RexWzh avatar RexWzh commented on June 23, 2024

话说,有用过这个 API 的可以介绍下吗?

看了文档,创建 API key 的第三步需要企业认证:

  1. API key 有效时长由duration_seconds定义,单位为秒;
  2. AK/SK 可通过API访问密钥 页面获取;
  3. Endpoint ID 可通过火山方舟 - 模型推理获取,格式为ep-xxxxxx;
  4. resource_ids 支持输入多个 Endpoint ID。

只有个人实名访问不了这里:

image

from one-api.

guobaozu avatar guobaozu commented on June 23, 2024

那在代码之前,豆包的这样的API调用如何才能使用?
curl https://ark.cn-beijing.volces.com/api/v3/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9"
-d '{
"model": "ep-2024051092-q5c",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Hello!"
}
],
"stream": true
}'

from one-api.

RexWzh avatar RexWzh commented on June 23, 2024

那在代码之前,豆包的这样的API调用如何才能使用? curl https://ark.cn-beijing.volces.com/api/v3/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9" -d '{ "model": "ep-2024051092-q5c", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ], "stream": true }'

这个和智谱类似,需要 API 鉴权。后缀的话可以直接配个 Nginx 转发。

server{
    listen 80;
    server_name xxx;
    location /v1 {
        proxy_pass  https://ark.cn-beijing.volces.com/api/v3;
        proxy_ssl_server_name on;
        proxy_set_header Host ark.cn-beijing.volces.com;
        proxy_set_header Connection '';
        proxy_http_version 1.1;
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

官方文档看着有点头大 🙄 ,又是 AK 又是 SK,身份认证后还要企业认证,有没弄过的可以简单介绍下(

image


翻了下文档,发现这里贴了在代码生产 API key 的方法。

HTTP 获取 API key (不推荐)
如果自己实现代码获取API key,需要用 AK/SK 进行旁路鉴权。代码逻辑可参考火山签名源码示例

Ref: Python 代码

from one-api.

guobaozu avatar guobaozu commented on June 23, 2024

那在代码之前,豆包的这样的API调用如何才能使用? curl https://ark.cn-beijing.volces.com/api/v3/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9" -d '{ "model": "ep-2024051092-q5c", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ], "stream": true }'

这个和智谱类似,需要 API 鉴权。后缀的话可以直接配个 Nginx 转发。

server{
    listen 80;
    server_name xxx;
    location /v1 {
        proxy_pass  https://ark.cn-beijing.volces.com/api/v3;
        proxy_ssl_server_name on;
        proxy_set_header Host ark.cn-beijing.volces.com;
        proxy_set_header Connection '';
        proxy_http_version 1.1;
        chunked_transfer_encoding off;
        proxy_buffering off;
        proxy_cache off;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

官方文档看着有点头大 🙄 ,又是 AK 又是 SK,身份认证后还要企业认证,有没弄过的可以简单介绍下(

image

翻了下文档,发现这里贴了在代码生产 API key 的方法。

HTTP 获取 API key (不推荐)
如果自己实现代码获取API key,需要用 AK/SK 进行旁路鉴权。代码逻辑可参考火山签名源码示例

Ref: Python 代码

感谢,已经在botgem上跑通。但是我在oneapi里自定义渠道,最后渠道测试也没问题,在使用的时候补全就是返回空。。。不知道为什么?您有在正常使用这个豆包的API吗?

from one-api.

zsinba avatar zsinba commented on June 23, 2024

能正常调用 。
需要 生成 一个 key,key 是最多 30 天有效期的。
但是合并 的代码跑第一个调用后,第二个就开始 闪退了。
具体的没有跟。

from one-api.

dimsky avatar dimsky commented on June 23, 2024

+1

from one-api.

Lands-1203 avatar Lands-1203 commented on June 23, 2024

+1

from one-api.

leavegee avatar leavegee commented on June 23, 2024

+1

from one-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.