|
| 1 | +--- |
| 2 | +title: Integrating Generative APIs with Cursor |
| 3 | +description: Learn how to integrate Scaleway Generative APIs with Cursor AI code editor for enhanced coding assistance using models like qwen3-coder-30b-a3b-instruct. Includes visual configuration guide. |
| 4 | +tags: generative-apis ai machine-learning language-models cursor |
| 5 | +dates: |
| 6 | + validation: 2025-10-22 |
| 7 | + posted: 2025-10-22 |
| 8 | +--- |
| 9 | +import Requirements from '@macros/iam/requirements.mdx' |
| 10 | + |
| 11 | +import cursorSettingsImage from './assets/scw-cursor-settings.webp' |
| 12 | + |
| 13 | +Cursor is an AI-powered code editor that helps developers write and edit code more efficiently. It can read your existing codebase, help you navigate it, and generate code based on your natural language descriptions. Built on top of Visual Studio Code, it allows you to integrate language models directly into your coding workflows. |
| 14 | + |
| 15 | +This guide will help you integrate Scaleway Generative APIs into Cursor. This lets you use models such as `qwen3-coder-30b-a3b-instruct` for code assistance and generation. |
| 16 | + |
| 17 | +<Requirements /> |
| 18 | + |
| 19 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 20 | +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 21 | +- A valid [API key](/iam/how-to/create-api-keys/) for API authentication |
| 22 | +- Installed [Cursor](https://cursor.com/) on your local machine, and logged in |
| 23 | + |
| 24 | +## Configuring Cursor to use Scaleway Generative APIs |
| 25 | + |
| 26 | +<Lightbox src={cursorSettingsImage} alt="Screenshot of Cursor settings interface showing the configuration for Scaleway Generative APIs, with fields for OpenAI API key and base URL override" /> |
| 27 | + |
| 28 | +1. Open Cursor in your browser. |
| 29 | +2. Click on the gear icon in the top right corner. The **Cursor Settings** screen displays. |
| 30 | +3. In the left sidebar, click **Models**. |
| 31 | +4. Uncollapse the **API Keys** section, and toggle on the **OpenAI API Key** setting. |
| 32 | +5. Paste the secret part of your [Scaleway API key](/iam/how-to/create-api-keys/) into the **OpenAI API Key** field. |
| 33 | +6. Toggle on the **Override OpenAI Base URL** option. |
| 34 | +7. Enter `https://api.scaleway.ai/v1` as your base URL in the field that displays. |
| 35 | + <Message type="tip"> |
| 36 | + If you are using a Project other than your [default Project](/organizations-and-projects/concepts/#default-project), modify the base URL accordingly: `https://api.scaleway.ai/{project_id}/v1` |
| 37 | + </Message> |
| 38 | +8. In the **Models** search bar at the top of the page, paste the name of the model you want to use, for example, `qwen3-coder-30b-a3b-instruct`. |
| 39 | +9. Click **Add Custom Model**, then **Add** next to the name of the matching model. |
| 40 | + |
| 41 | + The model is added. Close the **Cursor Settings** tab. |
| 42 | + |
| 43 | + <Message type="note"> |
| 44 | + Features requiring specialized models, such as Tab Completion, may still use Cursor's built-in models. [See the Cursor documentation](https://cursor.com/docs/settings/api-keys) for more details. |
| 45 | + </Message> |
| 46 | + |
| 47 | +## Verifying the integration |
| 48 | + |
| 49 | +To verify that Generative APIs are working correctly in Cursor: |
| 50 | + |
| 51 | +1. Open a new file or existing code file in Cursor. |
| 52 | +2. Use `Ctrl+L` (or `Cmd+L` on Mac) to open the AI chat pane. |
| 53 | +3. Ask the AI to help with a coding task, such as "Write a function to calculate the factorial of a number". |
| 54 | +4. Check that the AI responds with code suggestions. |
| 55 | + |
| 56 | +If the integration is working correctly, you should see AI-generated code suggestions that are relevant to your request. |
| 57 | + |
| 58 | +If you encounter any issues, verify that your API key is correct and that the base URL is properly configured. |
| 59 | + |
| 60 | +## Choosing a model |
| 61 | + |
| 62 | +We recommended using the following models with Cursor: |
| 63 | + |
| 64 | +- `qwen3-coder-30b-a3b-instruct` as the default choice for most tasks, especially autocompletion. |
| 65 | +- `qwen3-235b-a22b-instruct-2507` for agentic tasks. |
| 66 | +- `bge-multilingual-gemma2` for embeddings. |
| 67 | + |
| 68 | +You can add multiple custom models to Cursor. By default, it will use **Auto model selection** to determine which of your added models to use for a given task. To override this: |
| 69 | + |
| 70 | +1. Click **Auto** in the inline AI chat interface or at the bottom of the AI chat pane. |
| 71 | +2. Toggle off the **Auto** selection. |
| 72 | +3. Select the model you want Cursor to use from the list. |
0 commit comments