BYOK + Databricks AI Gateway — custom model names rejected ("Model name is not valid")

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Organization: … (Enterprise)


Issue:
When using Override OpenAI Base URL pointing to Databricks Unity AI Gateway
(https://.cloud.databricks.com/ai-gateway/cursor/v1) with a valid
Databricks PAT, Cursor rejects all custom model names with:
“Model name is not valid: ”
The same models work via direct curl to the gateway endpoint (200 OK).
Request never reaches Databricks — validation fails client/server-side in Cursor.
Models tested (all rejected in Cursor, all work via curl):

  • databricks-claude-sonnet-5
  • developers.devops.huuuge-gemini-3_1-falsh-lite (custom model service)
    Additional context:
  • AWS Bedrock enabled causes request interception for non-Bedrock models
  • GPT-5.5 Pro requires Responses API (/openai/v1/responses), not chat/completions
    Request ID: 2cd074d2-3c5d-4e33-a9c4-643b311ac99d

Workspace: dbc-fddc0605-e757.cloud.databricks.com
TEST 1 — endpoint Cursor (chat/completions):
POST /ai-gateway/cursor/v1/chat/completions
model: databricks-claude-sonnet-5
→ HTTP 200
→ response: {“choices”:[{“message”:{“content”:“OK”}}], “model”:“us.anthropic.claude-sonnet-5”}
TEST 2 — GPT-5.5 Pro (Responses API):
POST /ai-gateway/openai/v1/responses
model: databricks-gpt-5-5-pro
→ HTTP 200
→ response: {“status”:“completed”, “output”:[…, {“text”:“OK”}]}
=== TEST 1: Claude Sonnet 5 (cursor/v1 chat/completions) ===
{“model”:“us.anthropic.claude-sonnet-5”,“choices”:[{“message”:{“role”:“assistant”,“content”:“OK”},“index”:0,“finish_reason”:“stop”}],“usage”:{“cache_read_input_tokens”:0,“completion_tokens”:4,“prompt_tokens”:10,“total_tokens”:14,“cache_creation_input_tokens”:0},“object”:“chat.completion”,“id”:“msg_bdrk_kzknrwzuke76armdyfernujm5r5lokrumtnzkxdan4sevhjzjm3a”,“created”:1786537138}
HTTP_STATUS:200

=== TEST 2: GPT-5.5 Pro (openai/v1 responses) ===
{“frequency_penalty”:0.0,“model”:“gpt-5.5-pro-2026-04-23”,“service_tier”:“default”,“top_p”:0.98,“completed_at”:1786537141,“background”:false,“usage”:{“input_tokens_details”:{“cache_write_tokens”:0,“cached_tokens”:0},“input_tokens”:11,“output_tokens_details”:{“reasoning_tokens”:11},“total_tokens”:29,“output_tokens”:18},“tool_choice”:“auto”,“max_output_tokens”:300,“presence_penalty”:0.0,“parallel_tool_calls”:true,“temperature”:1.0,“tools”:,“store”:false,“text”:{“format”:{“type”:“text”},“verbosity”:“medium”},“moderation”:null,“top_logprobs”:0,“object”:“response”,“max_tool_calls”:null,“reasoning”:{“context”:“current_turn”,“effort”:“high”,“mode”:“pro”,“summary”:null},“tool_usage”:{“image_gen”:{“input_tokens_details”:{“image_tokens”:0,“text_tokens”:0},“input_tokens”:0,“output_tokens_details”:{“image_tokens”:0,“text_tokens”:0},“total_tokens”:0,“output_tokens”:0},“web_search”:{“num_requests”:0}},“id”:“resp_0193f5f75963c8f4016a7c64b2f44c819e88318d6e5434dece”,“error”:null,“prompt_cache_retention”:“24h”,“status”:“completed”,“metadata”:{},“created_at”:1786537138,“incomplete_details”:null,“instructions”:null,“output”:[{“encrypted_content”:“gAAAAABqfGS19xYlDhvy5Pkg7N9GkhRCXb61GWCdZdsE22MkN3q_unQrw6BVlgW6tqrcra25sLKDEpb4shZMmf1Fo0QyviziVb-U_e-UImPDq5Aujo5SBk-j676cpKQdx-vT0xPgZUhe8MbPu2R_goxTklGMPf5zQO8I3_LUwrwUkTGW0b6ucmjO8KyAu9-vPfu64GSWbzqdKTX0A6rneHzltSWOOiu2hV-Hzt-FMietXz4yYLyM2oYz1ZW0_BN1ZN6q6sbB6lEv0Q-AfVrZHvCNSBpam5ohNF_P0VY2S0ssA0EVlUYl2ogw2SWUb7rVkDMzEaanIrBjxdBAzKHl2fxLuXd7_nw_vhU8ANI-Xgezuetbav9XVF_czaJzbf2gLSMBbrTUlvonrI8-YGyTxuwhnvMuPciF8u64ANq9OtMkUGqhDCE6Rm_jEWIsikXXXf0QwlbyeMe0UsDF4mzxXiRgYMeeoS0hnzBi7SVnrulehXSkydM2zrpEi4PJJHDncze2CcZIIFHqQmvvHSDDlrobE873y-hGqvbn9cg8aSSwQa51dOAaBrrMVnAoKRNnSguuyCQ5rN-9kk5o12EJAFVyEbO3akdMRHmnQdaPoh3UYlH4TFvv4xAFzPBS96MmtJ7GWR1o9MotojXNl7mLB-8HjsPCU5-yLWh-J6GExdq4NogDK4aKg4phQHplL2yhSY-mQRxtgy-ckbQQDN1a8zXR-qID9qZ0uhBA5XXN3QMf7KJ5R8jsteqI7NPDk8Of97b5RcC-lpKrkYw7E8lz4kp37v_VnRRmbe847pBkfZCSeTVJauM1oLKTNoVUzeMqmU9UFoCi7qcebgvZffFIj1ZE1TSGuXpVrL7RjFdyLZDlY6xBh-XhHpSHSDWaduFhH8H9lsM4Fun9HBySntgDrwCcaC0Cfy7ywb0VOwwrBseTxY9_oNeXjQEQuT_IQweFlh7TyBJXSOWDDsHwzxZz3KWiDNv1PekQ==”,“id”:“rs_0193f5f75963c8f4016a7c64b5ca1c819ebdd74e2f4747eb2b”,“content”:,“type”:“reasoning”,“summary”:},{“role”:“assistant”,“phase”:“final_answer”,“id”:“msg_0193f5f75963c8f4016a7c64b5caf8819eab0c699a54579677”,“status”:“completed”,“content”:[{“type”:“output_text”,“annotations”:,“logprobs”:,“text”:“OK”}],“type”:“message”}],“billing”:{“payer”:“developer”},“previous_response_id”:null,“safety_identifier”:“org_745578103045208”,“user”:null,“truncation”:“disabled”,“prompt_cache_key”:null}
HTTP_STATUS:200

Ask: Support for Databricks model service names in BYOK, or official Databricks
provider integration similar to AWS Bedrock.

Steps to Reproduce

Try to use databricks as openAI override

Operating System

MacOS

Version Information


Version: 3.14.7
VS Code Extension API: 1.128.0
Commit: a758f2241ca99fecf380180b6cbdbbce0f1f42c0
Date: 2026-07-30T06:41:34.009Z
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

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey there! Thanks for the detailed report, the curl comparisons really helped narrow this down.

1. “Model name is not valid” - Custom model names do work here, so the gateway names aren’t the issue. That error means the request is reaching us without your key attached. In Cursor Settings → Models, under OpenAI API Key, check that the Use OpenAI API key switch is actually on (pasting the key and flipping that switch are separate steps). Two more things if it’s still failing: re-add the key from Settings rather than an in-editor prompt, and since you’re on a team, confirm BYOK is enabled in your team admin settings. Let me know if the error persists after that.

2. Bedrock - Turn AWS Bedrock off while using the base URL override. When it’s on, everything routes through Bedrock and anything it doesn’t serve fails there. This is an issue we’re tracking; toggling Bedrock off is the way around it today.

3. GPT-5.5 Pro - For a custom base URL, Cursor only calls /chat/completions, not /openai/v1/responses. Your test hit the Responses path, so worth checking if your gateway also serves that model over chat/completions:

curl -sS -X POST "https://<workspace>.cloud.databricks.com/ai-gateway/cursor/v1/chat/completions" \
-H "Authorization: Bearer $DATABRICKS_TOKEN" -H "Content-Type: application/json" \
-d '{"model":"databricks-gpt-5-5-pro","messages":[{"role":"user","content":"OK"}],"max_tokens":10}'

If that returns 200, it should work in Cursor once the key’s attached. If it only answers on the Responses path, others have asked for that too and we’ve let the team know.

4. Databricks integration - Not something we have today; the base URL override is the path for now. We’ll track this thread to gauge interest, so chime in here if others need it.

Mohit,

You’re right it works well. The problem was in toggle “OpenAI API Key” - it was OFF as I thought it’s to direct openAI communications. Additionally “secret saved” appeared so my PAT was stored successfully, didn’t expect without toggle even proper PAT won’t be used. Anyway - now it works as a dream.

It would be fine to have the bedrock integration ON at the same time and/or the databricks integration natively included (as bedrock, azure) but most important it works and I can consume my wallet on databricks.

67b459a5-f22b-4527-ada8-3dae1895806e - not OK (toggle off)
37d1cb6c-ee42-4ff9-abab-3242f851f3a9 - not OK (deprecated model)

accc3f2c-1992-4038-91cd-70875fadf5d0 - OK
cbffcf91-6423-4d4a-b701-3476b6d40f18 - OK

Settings → Models → API Keys:
Override OpenAI Base URL: https://.databricks.com/ai-gateway/cursor/v1
OpenAI API Key: ON + Databricks PAT (dapi…)
AWS Bedrock: OFF (when Bedrock is enabled, it intercepts requests)

Operational notes:

  • The OpenAI API Key toggle MUST be ON (OFF → misleading error “Model name is not valid”)
  • The Override URL may reset to api.openai.com/v1 — verify after restart
  • The PAT field may be grayed out — workaround: Tab → paste the key
  • “OpenAI API Key” ≠ billing to OpenAI — with Override enabled, traffic goes to Databricks