# Come usare la propria chiave API in Cursor IDE

Cursor Pro costs $20/month with a usage cap. With a RunAPI key you pay per token — the same Claude and GPT-4o models at 50% off official rates, no monthly fee, no Pro subscription required. This guide covers where to paste your key in Settings &gt; Models, how to set the base URL (the step most guides skip), and how to fix the common &#39;unauthorized user api key&#39; error.

*Updated June 23, 2026 · RunAPI Editorial*

## Posso usare Cursor con la mia chiave API?

Yes. Cursor lets you add your own API key on the free plan — you do not need Cursor Pro. Go to Settings &gt; Models, scroll to the OpenAI section, and fill in two fields: the OpenAI Base URL (https://runapi.ai/v1) and the OpenAI API Key (your RunAPI key). RunAPI gives you access to Claude 3.5 Sonnet, GPT-4o, Gemini, and other models at 50% of what Anthropic and OpenAI charge directly. The most common setup error — the &#39;unauthorized user api key&#39; message — means the base URL field is empty, so Cursor is sending your key to the wrong endpoint.

- **Funziona su tutti i piani Cursor**: You do not need a Pro subscription to use your own API key. BYOK works on the free Cursor tier and on Pro.
- **Endpoint compatibile con OpenAI**: RunAPI uses the same request and response format as the OpenAI API. Cursor&#39;s OpenAI API Key field accepts it without any code changes.
- **50% di sconto sui prezzi ufficiali dei modelli**: RunAPI fattura alla metà del prezzo di listino del fornitore. L&#39;input Claude 3.5 Sonnet costa 1,50 $/M token tramite RunAPI rispetto a 3,00 $/M direttamente tramite Anthropic.
- **Correggere &#39;unauthorized user api key&#39;**: This error almost always means the OpenAI Base URL field is empty. Set it to https://runapi.ai/v1 alongside your key and the error clears.

## Dove inserire la chiave API in Cursor

Cursor keeps all model configuration in one place. Open Cursor, press Cmd+Shift+J (Mac) or Ctrl+Shift+J (Windows/Linux) to open Settings, then click the Models tab on the left. Find the OpenAI section — you need to fill in two fields there. The OpenAI Base URL tells Cursor to send requests to RunAPI instead of OpenAI directly. The OpenAI API Key field is where you paste your RunAPI key. Both fields must be set. If you leave the base URL blank, Cursor sends your key to api.openai.com, which will reject it every time.

## Correggere l&#39;errore &#39;unauthorized user api key&#39; in Cursor

The &#39;unauthorized user api key&#39; message from Cursor means one of three things. First, the OpenAI Base URL field is empty, so Cursor sends your RunAPI key to api.openai.com, which rejects it — this is the most common cause. Second, the key was copied with a leading or trailing space. Third, the key was revoked or regenerated and the old value is stale. RunAPI keys start with &#39;rp-&#39; and are not standard OpenAI keys — they will always fail if Cursor tries to authenticate them against openai.com. Always set the base URL alongside the key. If a specific model still returns an error after the key and URL are correct, double-check the model name matches the exact slug shown at runapi.ai/pricing — a mismatch returns a different error than an auth failure.

### URL base mancante

La causa più comune. Se OpenAI Base URL è vuoto, Cursor invia la tua chiave RunAPI a api.openai.com, che la rifiuta. Impostare l&#39;URL base su https://runapi.ai/v1 e l&#39;errore scomparirà.

### Chiave copiata con spazi aggiuntivi

Paste the key and look for a leading or trailing space. Some terminals and browsers add invisible whitespace when you copy. Delete the field and paste again if in doubt.

### Chiave scaduta o revocata

Le chiavi RunAPI possono essere revocate dalla dashboard. Se di recente si è rigenerata la chiave, il vecchio valore restituirà un 401. Copiare la nuova chiave da Dashboard &gt; API Keys.

### Slug modello errato

Se la chiave e l&#39;URL sono corretti ma un modello specifico restituisce un errore, il nome del modello potrebbe non corrispondere al catalogo RunAPI. Verificare lo slug esatto su runapi.ai/pricing e incollarlo nel campo modello di Cursor.


## Vale la pena Cursor Pro a 20 $/mese, o conviene usare la propria chiave?

Cursor Pro gives you a fixed monthly allowance of fast-model requests. Once you hit the cap, Cursor slows you down or stops until the month resets. BYOK with RunAPI has no cap — you pay per token at 50% of official rates. For most developers, the break-even point is around 8–12 hours of heavy AI coding per month. Below that, RunAPI costs less. Above that, a subscription becomes more predictable but not necessarily cheaper.

## Come usare la propria chiave API in Cursor con RunAPI

1. **Creare un account RunAPI gratuito** — Andare su runapi.ai e registrarsi. Non è richiesta nessuna carta di credito. Si ottiene un piccolo credito gratuito per testare la connessione.
2. **Copiare la chiave API e l&#39;URL base** — In the RunAPI dashboard, go to API Keys and generate a key. Copy it right away and note the base URL — it is https://runapi.ai/v1.
3. **Aprire le Impostazioni di Cursor** — In Cursor, press Cmd+Shift+J (Mac) or Ctrl+Shift+J (Windows/Linux) to open Settings. Click the Models tab on the left sidebar.
4. **Inserire l&#39;URL base** — Scroll to the OpenAI section. Paste https://runapi.ai/v1 into the OpenAI Base URL field. Most guides skip this step — without it, Cursor sends all requests to OpenAI and rejects your key.
5. **Paste your key and click Enable** — Paste your RunAPI key into the OpenAI API Key field. Check that there is no leading or trailing whitespace. Toggle the OpenAI section on if it is off, then click Verify or Enable.
6. **Selezionare un modello e testare** — In the Cursor chat bar, choose a model such as gpt-5.4. Send a test message. A response confirms the connection works. Check your RunAPI dashboard under Usage to see the request logged.

## Domande frequenti sulla configurazione della chiave API in Cursor

### Perché Cursor mostra &#39;unauthorized user api key&#39;?

Questo errore appare quando Cursor non riesce ad autenticare la chiave contro l&#39;endpoint di destinazione. Il motivo più comune è che il campo OpenAI Base URL è vuoto, quindi Cursor invia la chiave RunAPI a api.openai.com, che la rifiuta. Impostare l&#39;URL base su https://runapi.ai/v1 insieme alla chiave per risolvere il problema.

### Do I need a Pro version of Cursor to add custom API keys?

No — you do not need a Pro subscription to use your own API key. Cursor lets you add custom API keys on the free plan. Go to Settings &gt; Models, paste your key into the OpenAI API Key field, set the base URL, and you are done. Cursor&#39;s own built-in model requests have separate limits, but those do not apply when you supply your own key.

### Quali modelli posso usare in Cursor tramite RunAPI?

Qualsiasi modello nel catalogo RunAPI che espone un endpoint di chat completions — inclusi Claude 3.5 Sonnet, Claude 3.7 Sonnet, GPT-4o, GPT-4.1, Gemini 1.5 Pro e Llama 3.1. Inserire lo slug del modello esatto da runapi.ai/pricing nel campo modello di Cursor. I modelli di immagini e audio non sono disponibili nell&#39;interfaccia chat di Cursor.

### RunAPI è più economico di Cursor Pro?

Per uso leggero o moderato, sì. Cursor Pro a 20 $/mese è adatto agli sviluppatori che preferiscono una tariffa fissa. RunAPI fattura per token al 50% dei prezzi di listino del fornitore — Claude 3.5 Sonnet costa 1,50 $/M token di input. Gli utenti intensivi che rimangono entro il limite Pro potrebbero trovare l&#39;abbonamento più prevedibile, ma con RunAPI non c&#39;è limitazione.

### Posso usare la stessa chiave RunAPI in Windsurf e Claude Code?

Sì. Una chiave RunAPI funziona in Cursor, Windsurf, Claude Code, Codex e qualsiasi altro strumento che accetti un endpoint personalizzato compatibile con OpenAI. Utilizzo e spesa sono consolidati in un&#39;unica dashboard RunAPI, quindi non è necessario gestire chiavi o saldi separati per strumento.

### Qual è l&#39;OpenAI Base URL da inserire in Cursor?

Impostarla su https://runapi.ai/v1. Cursor usa questo URL per tutte le richieste al modello quando la sezione OpenAI è attiva. Senza questo campo, Cursor invia le richieste a api.openai.com, che rifiuterà una chiave RunAPI e restituirà un errore non autorizzato ogni volta.

### Usare BYOK in Cursor disabilita le funzionalità integrate di Cursor?

No. Il completamento automatico, la vista diff e le funzionalità agente di Cursor continuano a funzionare. BYOK cambia solo quale modello ed endpoint Cursor usa per la chat e i completamenti inline. Se si imposta un modello che l&#39;interfaccia di Cursor non elenca per impostazione predefinita, digitare lo slug direttamente nel selettore di modelli.

### Come faccio a sapere se la mia chiave RunAPI funziona in Cursor?

Inviare un breve messaggio nella chat di Cursor e controllare la dashboard RunAPI in Utilizzo. Una nuova voce di log con il nome del modello, il conteggio dei token e il costo appare entro pochi secondi da ogni richiesta. Se non appare nessuna voce, l&#39;URL base o la chiave non sta raggiungendo RunAPI.

