← Back to "How it works?"

API Integration & IDE (Cursor / VS Code)

Step 1: Generate API Key

To connect to the cluster externally, you need an authorization key.

  1. Log in to the PrivatAI panel via your browser.
  2. Click your profile icon (top right corner) and select Settings.
  3. Go to the Account tab.
  4. In the "API Keys" section, click + Create new secret key.
  5. Copy the generated key (starts with sk-...). You will need it in the next step.

Step 2: Configuration in Cursor / VS Code

Our cluster is 100% compatible with the OpenAI standard. You just need to change the target address.

Connection Parameters:

API Type / Provider
OpenAI Compatible
Base URL
https://ai.privatai.pl/ollama/v1
API Key
[Paste the key generated in Step 1 here]
Model Name
gemma2:latest

*If you are using a specific model version (e.g., 27b), check its exact name in the chat window.

Step 3: Verification

After entering the data, try sending a simple query in the Cursor chat window (e.g., "Hello, are you Gemma?"). If you receive a response, the connection is active and encrypted.

All queries sent via API are subject to the same security rules (no logging of content, no model training).

Step 4: Network Configuration (Required)

Our system is protected by Cloudflare Zero Trust. Developer tools (Cursor, VS Code) do not support email/PIN login screens, so your IP address must be added to our whitelist (Bypass).

👉 If the connection fails, please send your fixed office IP address to: ai@privatai.pl for authorization.