Hey, my company gave us proxy e.g.: https://aiproxy.com.mycompany
With api key: sk-xxxxxxxxxxxxxxxxxxxxxx < exact number of characters
When hitting with curl to https://aiproxy.com.mycompany/models with auth Bearer sk-xxxxxxxxxxxxxxxxxxxxxx, I got this response:
{"data":[{"id":"openai/gpt-5","object":"model","created":1677610602,"owned_by":"openai"}],"object":"list"}
(There is more models but I removed them to show only the structure)
When overriding the OpenAI URL in Cursor and putting api key there I got this error:
{"error":"ERROR_BAD_USER_API_KEY","details":{"title":"Bad User API key","detail":"Unauthorized User API key","isRetryable":false,"additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}
ConnectError: [unauthenticated] Error
I thought, maybe there is a problem with the response, so I’ve configured Open Web UI, added this URL + API key and everything works fine, there are lot’s of models, GPT and Claude.
Open Web UI has feature that it might be used as a proxy for the models (so now I have proxy to proxy, yay!)
So now when I hit this:
curl ``http://192.168.0.175:3000/api/models`` -H "Authorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX << also exact number of characters
I got this response:
{"data":[{"id":"openai/gpt-5","object":"model","created":1677610602,"owned_by":"openai","connection_type":"external","name":"openai/gpt-5","openai":{"id":"openai/gpt-5","object":"model","created":1677610602,"owned_by":"openai","connection_type":"external"},"urlIdx":0,"actions":[],"filters":[],"tags":[]},{"id":"arena-model","name":"Arena Model","info":{"meta":{"profile_image_url":"/favicon.png","description":"Submit your questions to anonymous AI chatbots and vote on the best response.","model_ids":null}},"object":"model","created":1760962360,"owned_by":"arena","arena":true,"actions":[],"filters":[],"tags":[]}]}
also this works:
curl http://192.168.0.175:3000/api/chat/completions \
-H "Authorization: Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"model": "openai/gpt-5", "messages": [{"role": "user", "content": "test"}]}'
{"id":"chatcmpl-CSiNGhZPxQenTEERW7cIGaLid15eW","created":1760959794,"model":"gpt-5-2025-08-07","object":"chat.completion","choices":[{"finish_reason":"stop","index":0,"message":{"content":"Test received. How can I help you today?","role":"assistant","annotations":[]},"provider_specific_fields":{}}],"usage":{"completion_tokens":83,"prompt_tokens":7,"total_tokens":90,"completion_tokens_details":{"accepted_prediction_tokens":0,"audio_tokens":0,"reasoning_tokens":64,"rejected_prediction_tokens":0},"prompt_tokens_details":{"audio_tokens":0,"cached_tokens":0}},"service_tier":"default"}
so now I added this
And still I have the error:
Unauthorized User API key
(Request ID: 8ae3e3b9-239f-4ea5-bab8-5da1d18ddda5)
Do I do something wrong or it’s just not compatible with Cursor? I also tried to do:
curl ``http://192.168.0.175:3000/api/v1/chat/completions < with v1 and it still works, however in Cursor it doesn’t.
