getcursor / cursor

The AI Code Editor
https://cursor.com
25.02k stars 1.56k forks source link

Override base URL for proxying OpenAI's API #708

Open ryderwishart opened 1 year ago

ryderwishart commented 1 year ago

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.

axsaucedo commented 2 months ago

+1

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

ethan-0l commented 1 month ago

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 :

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,........
ShahryarSaljoughi commented 3 weeks ago

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