# Jak używać własnego klucza API w 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*

## Czy mogę używać Cursor z własnym kluczem 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.

- **Działa we wszystkich planach 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 kompatybilny z 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% taniej od oficjalnych cen modeli**: RunAPI rozlicza po połowie oficjalnej ceny dostawcy. Wejście Claude 3.5 Sonnet kosztuje $1.50/M tokenów przez RunAPI w porównaniu do $3.00/M przez Anthropic bezpośrednio.
- **Napraw &#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.

## Gdzie wprowadzić klucz API w 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.

## Naprawianie błędu &#39;unauthorized user api key&#39; w 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.

### Brakujący bazowy URL

Najczęstsza przyczyna. Jeśli OpenAI Base URL jest puste, Cursor wysyła Twój klucz RunAPI do api.openai.com, który go odrzuca. Ustaw bazowy URL na https://runapi.ai/v1, a błąd zniknie.

### Klucz skopiowany z dodatkowym białym znakiem

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.

### Wygasły lub odwołany klucz

Klucze RunAPI można odwołać z poziomu panelu. Jeśli niedawno wygenerowałeś nowy klucz, stara wartość zwróci błąd 401. Skopiuj nowy klucz z Dashboard &gt; API Keys.

### Nieprawidłowy slug modelu

Jeśli klucz i URL są poprawne, ale określony model zwraca błąd, nazwa modelu może nie pasować do katalogu RunAPI. Sprawdź dokładny slug pod adresem runapi.ai/pricing i wklej go w pole modelu w Cursor.


## Czy Cursor Pro za $20/month jest wart swojej ceny, czy lepiej używać własnego klucza?

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.

## Jak używać własnego klucza API w Cursor z RunAPI

1. **Utwórz bezpłatne konto RunAPI** — Przejdź na runapi.ai i zarejestruj się. Karta kredytowa nie jest wymagana. Otrzymasz mały bezpłatny kredyt na przetestowanie połączenia.
2. **Skopiuj klucz API i bazowy URL** — 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. **Otwórz Ustawienia 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. **Wprowadź bazowy URL** — 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. **Wybierz model i przetestuj** — 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.

## FAQ dotyczące konfiguracji klucza API w Cursor

### Dlaczego Cursor wyświetla &#39;unauthorized user api key&#39;?

Ten błąd pojawia się, gdy Cursor nie może uwierzytelnić Twojego klucza na docelowym endpointcie. Najczęstszą przyczyną jest puste pole OpenAI Base URL, przez co Cursor wysyła Twój klucz RunAPI do api.openai.com, który go odrzuca. Ustaw bazowy URL na https://runapi.ai/v1 obok swojego klucza, aby to naprawić.

### 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.

### Których modeli mogę używać w Cursor przez RunAPI?

Każdy model z katalogu RunAPI, który udostępnia endpoint uzupełnień czatu — w tym Claude 3.5 Sonnet, Claude 3.7 Sonnet, GPT-4o, GPT-4.1, Gemini 1.5 Pro i Llama 3.1. Wprowadź dokładny slug modelu z runapi.ai/pricing w polu modelu w Cursor. Modele obrazów i audio nie są dostępne w interfejsie czatu Cursor.

### Czy RunAPI jest tańsze niż Cursor Pro?

Przy lekkim do umiarkowanego użycia — tak. Cursor Pro za $20/month jest odpowiedni dla programistów, którzy chcą płacić stałą opłatę. RunAPI rozlicza za token przy 50% oficjalnych cen dostawców — Claude 3.5 Sonnet kosztuje $1.50/M tokenów wejściowych. Intensywni użytkownicy, którzy nie przekraczają limitu Pro, mogą uznać subskrypcję za bardziej przewidywalną, ale z RunAPI nie ma throttlingu.

### Czy mogę używać tego samego klucza RunAPI w Windsurf i Claude Code?

Tak. Jeden klucz RunAPI działa w Cursor, Windsurf, Claude Code, Codex i każdym innym narzędziu, które przyjmuje własny endpoint kompatybilny z OpenAI. Użycie i wydatki są skonsolidowane w jednym panelu RunAPI, więc nie musisz zarządzać osobnymi kluczami ani saldami dla każdego narzędzia.

### Jaki bazowy URL OpenAI muszę wprowadzić w Cursor?

Ustaw go na https://runapi.ai/v1. Cursor używa tego URL dla wszystkich żądań modeli, gdy sekcja OpenAI jest aktywna. Bez tego pola Cursor wysyła Twoje żądania do api.openai.com, który odrzuci klucz RunAPI i za każdym razem zwróci błąd nieautoryzowanego dostępu.

### Czy używanie BYOK w Cursor wyłącza wbudowane funkcje Cursor?

Nie. Autouzupełnianie, widok diff i funkcje agenta Cursor nadal działają. BYOK zmienia tylko to, którego modelu i endpointu Cursor używa do czatu i wbudowanych uzupełnień. Jeśli ustawisz model, którego interfejs Cursor nie wyświetla domyślnie, wpisz slug bezpośrednio w selektor modelu.

### Jak sprawdzić, czy mój klucz RunAPI działa w Cursor?

Wyślij krótką wiadomość w czacie Cursor i sprawdź panel RunAPI pod pozycją Użycie. Nowy wpis dziennika z nazwą modelu, liczbą tokenów i kosztem pojawia się w ciągu kilku sekund od każdego żądania. Jeśli żaden wpis się nie pojawi, bazowy URL lub klucz nie docierają do RunAPI.

