肝了半天!Gemini CLI转API,任意客户端畅享1000次/日 Gemini-2.5请求

太强了吧

1 Like

好的,收到

[Auth] Received successful callback from Google: xxxxxx
[Auth] Ignoring irrelevant request: /favicon.ico

[Server] Received request: POST http://localhost:8000/v1/chat/completions
[Service] Initializing Gemini API Service...
[Auth] Credentials file '/Users/xxx/.gemini/oauth_creds.json' not found. Starting new authentication flow...

登录账号授权成功,请求的时候提示仍然要授权,oauth_creds.json文件没有生成


更新:设置全局代理后可以正常使用了,厉害:+1:

mark一下

1 Like

太强辣大佬

1 Like

这样设置代理也行

  • Windows (CMD):
    set http_proxy=http://127.0.0.1:7890
    set https_proxy=http://127.0.0.1:7890
    
  • Windows (PowerShell):
    $env:http_proxy="http://127.0.0.1:7890"
    $env:https_proxy="http://127.0.0.1:7890"
    
  • macOS/Linux (Bash/Zsh):
    export http_proxy=http://127.0.0.1:7890
    export https_proxy=http://127.0.0.1:7890
    

佬太强啦

1 Like

厉害啊大佬,太强了

1 Like

这个输出之后是在重试,最后是生成了oauth_creds.json,还是有其他报错?

  • Windows (CMD):
    set http_proxy=http://127.0.0.1:7890
    set https_proxy=http://127.0.0.1:7890
    
  • Windows (PowerShell):
    $env:http_proxy="http://127.0.0.1:7890"
    $env:https_proxy="http://127.0.0.1:7890"
    
  • macOS/Linux (Bash/Zsh):
    export http_proxy=http://127.0.0.1:7890
    export https_proxy=http://127.0.0.1:7890
    

也可以终端全局代理

1 Like

太强了佬,已经部署成功了,但是想问一下,怎么能让cursor也调用这个openai的接口呀?写了地址和api后提示:


[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

[Server] Received request: OPTIONS http://127.0.0.1:3000/v1/chat/completions
[Auth] Unauthorized request denied. Bearer token: "N/A", Query key: "null", Header key: "undefined"

我用cherrystudio是可以的

啊,cline都行,cursor居然不行
function isAuthorized(req, requestUrl)这个方法把header打印出来看看

太强了,佬

1 Like

牛掰克拉斯…大佬

1 Like

确认是cursor的bug了,添加不了自定义api

啊hhh麻烦大佬测试,我那会出去了一趟。那想用cursor目前是没办法了嘛~ 自定义api在openai的接口是可以添加的,但是加了之后会报错。

你可以通过校验?我点校验就看到你那个报错

感谢巨佬的分享 :melting_face:

2 Likes

这个api不行,其他的newapi可以,但是发送消息会报错,缺少参数

我用oneapi,deepseek的api都不行啊,验证都没反应,不谈后面发消息