modulepackage
0.5.1
Repository: https://github.com/dalefengs/chat-api-proxy.git
Documentation: pkg.go.dev
# README
chat-api-proxy
{USN~
- f:_'YNؚHevAPIlS]wQ,`Ov_SfROwc0
- /ecYylSe_
- Copilot2GPT4
- CoCopilot2GPT4 (bfHr)
- Gemini2ChatAPi
- bNv]wQ/ecAm_lSeI{_0
- Copilot QnN tokens X[MQ͑ YBlS0
- /ec Jetbrains IDE0VSCode0Vim/NeoVim I{hVNtO(u Copilot Chat0
- r Copilot2GPT4 (W gRhV NTNIPNO(u2R`IP\S0
- Copilot2GPT4 (NaYIPO(uYIP(u[f[e\S(CoCopilot bfHrTt)
- 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'
- cS:NGETBl0
- cocopilothttps://cocopilot.org/dash
- Authorization: token Tb:N`OS0Rv cocopilot Token0
&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