1. What is Cursor?
Cursor is an AI-native code editor built on top of VS Code, featuring deep integration with AI chat, code generation (Composer/Chat), and intelligent code completion. It supports BYOK (Bring Your Own Key), allowing you to connect your own model endpoints using your personal API key—perfect for scenarios where you prefer not to purchase an official subscription or want to consolidate your model usage.
By connecting through a relay service, you can use Claude, GPT, or Gemini models via your own sk- API key on a pay-per-token basis, without needing an official Cursor subscription.
2. Preparation
- Log in to the Azztimes console and generate your exclusive
sk-xxxxxxkey under "API Keys". - Check the "Model Pricing" section to confirm the model slug you wish to use (e.g.,
claude-sonnet-5,gpt-5.4,gemini-3.7-flash). - Confirm the gateway URL:
https://www.relay-api.com.
3. Configuring in Cursor
Open Cursor → Settings → Models → API Keys (or simply search for Models in the settings):
- Select the model provider you wish to use (OpenAI for OpenAI, Anthropic for Claude, Google Gemini for Gemini).
- Enter your API Key:
sk-your-key. - Enter the Override Base URL: Use the corresponding gateway address based on your provider:
- Claude / Anthropic:
https://www.relay-api.com - GPT / OpenAI:
https://www.relay-api.com/v1 - Gemini:
https://www.relay-api.com/v1beta
- Claude / Anthropic:
- Add the specific model ID in the Models list (copy the slug from the model library; do not use the display name).
- Click Verify to test the connection; then send a short message in a regular Chat window to ensure it returns a valid response.
4. Verification and Troubleshooting
| Issue | Resolution |
|---|---|
| 401 / 403 | Key is invalid, disabled, or has insufficient balance; verify the sk- key and add credit. |
| 404 / Model unavailable | The model slug does not match the platform or the model is disabled; check the Model ID. |
| Verify succeeds but Agent fails | Differences in the /chat/completions protocol; verify basic connectivity via standard Chat first. |
| Tab completion not working | Tab Completion and other dedicated features use Cursor's internal models; this is a product constraint and not related to the Base URL configuration. |
Security Tip: Never commit your API keys to public repositories. It is recommended to create separate keys for each project and monitor your balance and usage details regularly.
