Categorygithub.com/dalefengs/chat-api-proxy
modulepackage
0.5.1
Repository: https://github.com/dalefengs/chat-api-proxy.git
Documentation: pkg.go.dev

# README

chat-api-proxy

Static Badge Docker Pulls

{USN~

  • f:_'YNؚHevAPIlS]wQ,`Ov_SfROwc0
  • /ecYylSe_
    • Copilot2GPT4
    • CoCopilot2GPT4 (bfHr)
    • Gemini2ChatAPi
  • bNv]wQ/ecAm_lS eI{_0
  • Copilot QnN tokens X[ MQ͑ YBlS0
  • /ec Jetbrains IDE0VSCode0Vim/NeoVim I{hVNtO(u Copilot Chat0
  • r Copilot2GPT4 (W gRhV N TNIP NO(u 2R`IP\S0
  • Copilot2GPT4 (NaYIPO(u YIP(u[f[e\S(CoCopilot bfHr Tt)
  • SN/TR:NBackendAPI Proxy!j_ vcO(uAccess Token(u/backend-api/Tchat2apivcS0sS\ReQ

Docker r

docker run -d \
  --name chat-api-proxy \
  -p 18818:8818 \
  -v LOG_LEVEL=info \
  dalefengs/chat-api-proxy

sXSϑ

  • PROXY_API_PREFIX API1uMR
  • LOG_LEVEL e_I{~debug, info, error
  • GEMINI_BASE_URL Gemini pro ꁚ[INNt0W@W
  • GEMINI_VERSION Gemini pro Api Hr,g(v1, v1betaI{)

API ech

Github Copilot

S Copilot Token

/copilot/copilot_internal/v2/token

curl --location 'http://127.0.0.1:18818/copilot/copilot_internal/v2/token' \
--header 'Authorization: token ghu_xxxxxxxxxxxxxxxx'
  • cS:NGETBl0
  • Authorization: token Tb:N`OS0Rv Github Token0

Completions [ecS

/chat/completions

curl --location 'http://127.0.0.1:18818/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer tid=xxxxxxxx;ol=xxb457a0be36d3;exp=1705149290;sku=copilot_for_business_seat;st=dotcom;ssc=1;chat=1;sn=1;8kp=1:18b175a4e4bbf73xx3a627e7180a6469540d8316884d4ea6713edb28' \
--data '{
    "stream": true,
    "model": "gpt-4",
    "messages": [
        {
            "role": "user",
            "content": "`O}Y"
        }
    ]
}'
  • cS:NPOSTBl0
  • Authorization: Bearer Tbvtoken:N`OS0Rv Copilot Token0

CoCopilot (bfHr)

S Copilot Token

/cocopilot/copilot_internal/v2/token

curl --location 'http://127.0.0.1:18818/cocopilot/copilot_internal/v2/token' \
--header 'Authorization: token cuu_xxxxxxxxxxxxxxxx'

&b0Rv ccu-xxx N[_OX[ 2bkl2W'W'W'

Completions cS

/v1/chat/completions

curl --location 'http://127.0.0.1:18818/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer cuu_xxxxxxxxxxxxxxxx' \
--data '{
    "stream": true,
    "model": "gpt-4",
    "messages": [
        {
            "role": "user",
            "content": "`O}Y"
        }
    ]
}'
  • cS:NPOSTBl0
  • Authorization: Bearer Tbvtoken:N`OS0Rv CoCopilot Token0

Gemini2ChatAPi

completions cS

curl --location 'http://127.0.0.1:18818/gemini/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer AIzaSyCGpzxxxxxxxxxx' \
--data '{
    "stream": true,
    "model": "gemini-pro",
    "messages": [
        {
            "role": "user",
            "content": "`O}Y"
        }
    ]
}'
  • cS:NPOSTBl0
  • Authorization: Bearer Tbvtoken:N`OS0Rv Copilot Token0
  • model :N gemini-pro b ꁚ[INv!jW Ty0

IDE Copilot Mn

g wech

Star History

Star History Chart

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author