# Cannot use openai models

**URL:** <https://forum.cursor.com/t/cannot-use-openai-models/168618>\
**Category:** Help\
**Tags:** byok, openai\
**Created:** [August 17, 2026, 8:33am UTC](https://forum.cursor.com/t/cannot-use-openai-models/168618 "2026-08-17T08:33:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdtl22](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@cdtl22](https://forum.cursor.com/u/cdtl22)\
**Post date:** [August 17, 2026, 8:33am UTC](https://forum.cursor.com/t/cannot-use-openai-models/168618/1 "2026-08-17T08:33:43Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

Request ID: c7b5bfdc-1055-4e1d-a748-cc3699f65594  
{“error”:“ERROR\_BAD\_USER\_API\_KEY”,“details”:{“title”:“Invalid API key.”,“detail”:“Unauthorized User API key”,“isRetryable”:false,“additionalInfo”:{},“buttons”:,“planChoices”:,“analyticsMetadata”:{“actionRequired”:“config”}},“isExpected”:true}  
Invalid API key. Unauthorized User API key  
ActionRequiredError: Invalid API key. Unauthorized User API key  
at NVg (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6983:82625)  
at C$s (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6983:81539)  
at nGg (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6984:12878)  
at Object.classify (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6984:17456)  
at YVg (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6984:5856)  
at async B$s.run (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6984:16808)  
at async Jae.runAgentLoop (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:7115:34599)  
at async fSo.streamFromAgentBackend (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:15029:14663)  
at async fSo.getAgentStreamResponse (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:15029:32134)  
at async nIe.\_submitChatMaybeAbortCurrent (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:7094:2524)

### Steps to Reproduce

this is a brand new api key with $5 of credit added on the openai side. it says “Invalid API key” when I try to use that api key taken from the openai side

### Expected Behavior

should be able to run a prompt in cursor IDE

### Screenshots / Screen Recordings

 ![Screenshot 2026-08-17 at 1.30.06 AM.png](https://us1.discourse-cdn.com/cursor1/original/3X/f/8/f82b214ea8ce688215f5cc5f15fded56525cf4cd.png) ![Screenshot 2026-08-17 at 1.32.23 AM.png](https://us1.discourse-cdn.com/cursor1/original/3X/e/a/ea17fb65293b5d177d239cc205dd2f521d00c332.png)

### Operating System

Linux

### Version Information

Version: 3.16.17  
VS Code Extension API: 1.128.0  
Commit: 6b2afae0257df2bb5e1835f15165dc2f0de056b0  
Date: 2026-08-14T01:41:12.803Z  
Layout: IDE  
Build Type: Stable  
Release Track: Default  
Electron: 40.10.3  
Chromium: 144.0.7559.236  
Node.js: 24.15.0  
V8: 14.4.258.32-electron.0  
xterm.js: 6.1.0-beta.291  
OS: Darwin arm64 25.5.0

### For AI issues: which model did you use?

GPT-5.6 Luna

### For AI issues: add Request ID with privacy disabled

n/a - do not want to disable privacy

### Additional Information

i have added the api key via Preference → Cursor Settings → Models → API Keys → OpenAI API Key

It says “Secret saved.” and the toggle is enabled

also this command on the terminal cli works fine and i receive a Pong response so I definitely think there’s something wrong with the cursor side:

```auto
curl https://api.openai.com/v1/chat/completions -H 
"Content-Type: application/json" -H "Authorization: Bearer <TOKEN>" -d '{
    "model": "gpt-5.6-luna",
    "messages": [{"role": "user", "content": "Ping"}]
  }'
{
  "id": "chatcmpl-<id>",
  "object": "chat.completion",
  "created": <created_date>,
  "model": "gpt-5.6-luna",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Pong!",
        "refusal": null,
        "annotations": []
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 7,
    "completion_tokens": 6,
    "total_tokens": 13,
    "prompt_tokens_details": {
      "cached_tokens": 0,
      "cache_write_tokens": 0,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  },
  "service_tier": "default",
  "system_fingerprint": null
}

```

### Does this stop you from using Cursor

Yes - Cursor is unusable

---

<div class="post-metadata">

**Author:** ![cdtl22](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@cdtl22](https://forum.cursor.com/u/cdtl22)\
**Post date:** [August 17, 2026, 12:26pm UTC](https://forum.cursor.com/t/cannot-use-openai-models/168618/4 "2026-08-17T12:26:40Z")

</div>

resolved once i removed whitelist from openai side

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [August 19, 2026, 12:27pm UTC](https://forum.cursor.com/t/cannot-use-openai-models/168618/6 "2026-08-19T12:27:01Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
