Enable Azure OpenAI settings when using cursor agent CLI

Feature request for product/service

Cursor CLI

Describe the request

Feature Request: Azure OpenAI Support in cursor agent CLI

Summary

Request: Upgrade the cursor agent CLI to respect the Azure OpenAI configuration set in Cursor’s GUI settings, or provide equivalent CLI flags/environment variables to route requests through Azure OpenAI.

Current Behavior

When using the Cursor GUI, I can configure Azure OpenAI in Settings (Base URL, Deployment Name, API Key), and chat/composer requests correctly route through my Azure OpenAI deployment.

However, when using cursor agent from the command line, requests always go through Cursor’s default API—the Azure OpenAI settings are ignored.

I tested several environment variables that the OpenAI SDK typically respects:

  • OPENAI_API_BASE
  • OPENAI_BASE_URL
  • AZURE_OPENAI_ENDPOINT
  • AZURE_OPENAI_API_KEY

None of these affected cursor agent routing.

Why This Matters

  1. Enterprise Azure agreements - Many organizations have negotiated Azure commitments and need to route AI usage through Azure for cost tracking and compliance.

  2. Data residency - Some organizations require AI requests to go through specific Azure regions for data sovereignty.

  3. Cost management - Azure provides detailed usage analytics and cost controls that aren’t available through Cursor’s bundled API.

  4. Parity with GUI - The CLI and GUI should behave consistently when the same settings are configured.

Proposed Solutions

Any of these would solve the problem:

Option A: Respect existing GUI settings

Have cursor agent read and use the Azure OpenAI configuration already set in Cursor’s settings.

Option B: CLI flags

cursor agent --azure-endpoint "https://myresource.openai.azure.com" \
             --azure-deployment "gpt-X.X" \
             --azure-api-key "$AZURE_KEY" \
             "my prompt"

Option C: Environment variables

CURSOR_AZURE_ENDPOINT="https://myresource.openai.azure.com" \
CURSOR_AZURE_DEPLOYMENT="gpt-X.X" \
CURSOR_AZURE_API_KEY="$AZURE_KEY" \
cursor agent "my prompt"

Option D: Config file

Support a .cursorrc or similar that can specify Azure routing for CLI usage.

Environment

  • Cursor version: 2.4.37
  • VSCode Version: 1.105.1
  • cursor agent version: 2026.02.13-41ac335

Related

This may also affect other CLI-based workflows like cursor tunnel or CI/CD integrations.

This can provide an alternate solution for some of the people affected by this existing issue: Cursor and GPT 5.2 On Azure not working - #10 by jka


Thanks for considering this! I’m happy to provide more details or help test a solution.