Giter Club home page Giter Club logo

chatgpt-adapter's Introduction

V2

使用

./linux-server -h

>>>>>
GPT接口适配器。统一适配接口规范,集成了bing、claude-2,gemini...
项目地址:https://github.com/bincooo/chatgpt-adapter

Usage:
  ChatGPT-Adapter [flags]

Flags:
  -h, --help             help for ChatGPT-Adapter
      --port int         服务端口 port (default 8080)
      --proxies string   本地代理 proxies
  -v, --version          version for ChatGPT-Adapter

启动服务,如果网络不在服务区域,请尝试设置/替换 proxies

./linux-server --port 8080 --proxies socks5://127.0.0.1:7890

请求列表

model 列表

{
    "id":       "claude-2",
    "object":   "model",
    "created":  1686935002,
    "owned_by": "claude-adapter"
},
{
    "id":       "bing",
    "object":   "model",
    "created":  1686935002,
    "owned_by": "bing-adapter"
},
{
    "id":       "coze",
    "object":   "model",
    "created":  1686935002,
    "owned_by": "coze-adapter"
},
{
    "id":       "gemini-1.0",
    "object":   "model",
    "created":  1686935002,
    "owned_by": "gemini-adapter"
},
{
    "id":       "command-r-plus",
    "object":   "model",
    "created":  1686935002,
    "owned_by": "cohere-adapter"
}

completions 对话

/v1/chat/completions
/v1/object/completions
/proxies/v1/chat/completions
curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization: xxx" \
   -d \
'{
  "stream": true,
  "model": "coze",
  "messages": [
    {
      "role":    "user",
      "content": "hi"
    }
  ]
}' \
 'http://127.0.0.1:8080/v1/chat/completions'

Authorization 获取

claude:

claude.ai 官网中登陆,浏览器 cookies 中取出 sessionKey 的值就是 Authorization 参数

bing:

www.bing.com 官网中登陆,浏览器 cookies 中取出 _U 的值就是 Authorization 参数

gemini:

ai.google.dev 中申请,获取 token凭证就是 Authorization 参数

coze:

www.coze.com 官网中登陆,浏览器 cookies 中复制完整的 cookie 就是 Authorization 参数

free画图接口

提供了 coze.dall-e-3sd.dall-e-3xl.dall-e-3, kb.dall-e-3, pg.dall-e-3,它们会根据你提供的 Authorization 选择其中的一个

// 下面三个固定写法

// sd.dall-e-3
Authorization: sk-prodia-sd

// xl.dall-e-3
Authorization: sk-prodia-xl

// kb.dall-e-3
Authorization: sk-krebzonide

api:

/v1/chat/generations
/v1/object/generations
/proxies/v1/chat/generations
curl -i -X POST \
   -H "Content-Type:application/json" \
   -H "Authorization: xxx" \
   -d \
'{
  "prompt":"一个二次元少女",
  "style":"",
  "model":"dall-e-3",
  "n":1
}' \
 'http://127.0.0.1:8080/v1/chat/generations'

特殊标记增强

flags

chatgpt-adapter's People

Contributors

bincooo avatar

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.