cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Override base URL for proxying OpenAI's API

Open ryderwishart opened this issue 2 years ago • 2 comments

This fork of VSCode is awesome.

I would like to be able to proxy OpenAI's API, e.g., by passing OpenAI API requests (same arguments, models, etc.) through a proxy served at http://localhost:8080/v1. I see that I can add a base URL for Azure, but I cannot toggle this endpoint on (I'm getting an error message about invalid credentials, but this is not due to an invalid OpenAI API key but, I suspect, something like a test API call running under the hood.)

Screenshot 2023-07-31 at 9 50 17 AM

I'd imagine that the simplest solution would be a settings field allowing users to override the base URL for OpenAI.

ryderwishart avatar Jul 31 '23 16:07 ryderwishart

+1

I'm getting an error when using a custom URL even if the command works on the terminal

axsaucedo avatar Sep 05 '24 05:09 axsaucedo

I got the same issue. My proxy is on a remote non public accessed network.

I got cursor to work with MITM proxy only when :

  • first : a real dns name is used.
  • second : only when the server is public accessible.

I wonder if chat box is not proxyied by their servers. We were just trying Cursor, so i don't know if I want to allow time to investigate network more.

Edit : Yes connexion are coming from : 3.89.66.125

{"remote_ip":"3.89.66.125","remote_port":"45486","client_ip":"3.89.66.125","proto":"HTTP/1.1","method":"POST","host":"xxxxxxxx","uri":"/chat/completions","headers":{"Connection":["keep-alive"],"Accept":["application/json, text/plain, */*"],"Content-Type":["application/json"],"Authorization":["REDACTED"],"User-Agent":["axios/1.6.2"],"Content-Length":["1983"],"Accept-Encoding":["gzip, compress, deflate, br"]}},"bytes_read":1983,"user_id":"","duration":0.xxx,"size":524,"status":200,........

ethan-0l avatar Sep 12 '24 16:09 ethan-0l

So no setting for changing the base URL is yet provided. Am I correct?

ShahryarSaljoughi avatar Oct 16 '24 07:10 ShahryarSaljoughi