> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sinarcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Continue with SinarCloud

> Add SinarCloud to Continue, the open source AI code agent for VS Code, and run its Agent, Chat and Edit features on SinarCloud models through the OpenAI Chat Completions format.

[Continue](https://marketplace.visualstudio.com/items?itemName=Continue.continue) is an open source AI code agent for Visual Studio Code. It can send its requests to any OpenAI-compatible API. Add a SinarCloud model to Continue's config file, and Continue's Agent, Chat and Edit features run on SinarCloud models, charged to your balance. You don't need a Continue account.

This guide was last checked with Continue 2.0.0.

## Before you start

* Get an API key and a model alias as described in [Before you connect](https://docs.sinarcloud.com/integrations/before-you-connect.md). The base URL is `https://ai.sinarcloud.com/v1`.

**1. Install Continue**

In VS Code, open the Extensions view: click **Extensions** in the Activity Bar, or press `Ctrl+Shift+X` (`Cmd+Shift+X` on macOS). Search for `Continue`.

In the results, find **Continue - open-source AI code agent**, published by **Continue**, and click **Install**.

![The Extensions: Marketplace view in VS Code with Continue typed in the search box. The first result is Continue - open-source AI code agent, described as The leading open-source AI code agent and published by Continue with a verified badge, with an Install button.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-install.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=bb9f5a8a1422faefc9ec819ef9de441f)

Continue in the Extensions view, ready to install

**2. Open the Configs page**

In the Activity Bar, click **Continue**. At the top of the Continue panel, click the gear icon (**Open Settings**). In the list on the left, click **Configs**.

The first time you open Continue, the panel shows a setup card with **API Key** and **Local** tabs. You don't need it, because you add SinarCloud in Continue's config file instead.

![The Continue panel in VS Code, open on its settings, with the Continue icon selected in the Activity Bar. The panel's title bar has New Session, View History and Open Settings icons. The settings list on the left has Back, Models, Rules, Tools, Configs and Indexing, with Configs selected. The Configs page lists Main Config with a gear icon on its right.](https://mintcdn.com/sinar-cloud/1ydOws_F7Drqtqre/images/integrations/continue-open-config.png?fit=max\&auto=format\&n=1ydOws_F7Drqtqre\&q=85\&s=02b5a343e64a07306b89be7e6f30bb7f)

Continue's settings, open on Configs

> [!TIP]
>
> If Continue shows **Screen width too small**, drag the edge of the side bar to make the Continue panel wider.

**3. Open config.yaml**

Next to **Main Config**, click the gear icon. Continue opens its config file, `config.yaml`, in the editor. In a new install, the file doesn't list any models yet: it ends with `models: []`.

![Continue's Configs page on the left and config.yaml open in the editor on the right. The file has four lines: name: Main Config, version: 1.0.0, schema: v1 and models: \[\]. Above the first line, Continue adds the links View Continue Reference and Download YAML extension for Intellisense.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-config-open.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=edf4b4ca8b57aa48a154c5072aa35ae1)

The gear next to Main Config opens config.yaml

Continue keeps this file in a folder named `.continue` in your home folder: `~/.continue` on macOS and Linux, or `%USERPROFILE%\.continue` on Windows.

**4. Save your API key in a .env file**

In the same `.continue` folder, create a file named `.env` and open it in VS Code. Paste this line into it, replace `paste-your-api-key` with your API key, and save the file:

```bash ~/.continue/.env theme={null}
SINARCLOUD_API_KEY=paste-your-api-key
```

Continue reads your key from this file, so it isn't stored in `config.yaml`.

![The editor with two tabs, config.yaml and .env. The .env tab is open and shows one line: SINARCLOUD\_API\_KEY=paste-your-api-key.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-env-file.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=6b36f04a465fb360c1b78d44c2133b72)

The .env file next to config.yaml

> [!WARNING]
>
> `.env` stores your key as plain text, so only do this on a computer that only you use. Keep the file in `~/.continue`. Continue also reads `.env` files inside your projects, but those are easy to commit to a repository by mistake.

**5. Add the SinarCloud model**

Switch back to `config.yaml`. Replace its contents with the following. If the file already lists models you want to keep, add the new entry under `models` instead.

```yaml ~/.continue/config.yaml theme={null}
name: Main Config
version: 1.0.0
schema: v1
models:
  - name: DeepSeek V4.1 Flash
    provider: openai
    model: deepseek/deepseek-v4-1-flash
    apiBase: https://ai.sinarcloud.com/v1
    apiKey: ${{ secrets.SINARCLOUD_API_KEY }}
    useLegacyCompletionsEndpoint: false
    roles:
      - chat
      - edit
      - apply
    capabilities:
      - tool_use
    defaultCompletionOptions:
      contextLength: 1000000
      maxTokens: 393216
```

Save the file. Continue loads `config.yaml` again and reads your `.env` file when you save, so you don't need to restart VS Code.

![config.yaml open in the editor with the SinarCloud model: name DeepSeek V4.1 Flash, provider openai, model deepseek/deepseek-v4-1-flash, apiBase https://ai.sinarcloud.com/v1, apiKey \$\{\{ secrets.SINARCLOUD\_API\_KEY }}, useLegacyCompletionsEndpoint false, the roles chat, edit and apply, the capability tool\_use, and defaultCompletionOptions with contextLength 1000000 and maxTokens 393216.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-config-file.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=7b73c2c3d01bdcf53bb7de0e184fbfba)

config.yaml with the SinarCloud model and its base URL

Here's what each part does:

* `provider: openai` with `apiBase` makes Continue send its requests to `https://ai.sinarcloud.com/v1` in the OpenAI Chat Completions format.
* `${{ secrets.SINARCLOUD_API_KEY }}` reads your API key from `~/.continue/.env`.
* `model` is the model alias from the **Models** page. `name` is the name Continue shows in its model menu.
* `useLegacyCompletionsEndpoint: false` keeps every request on Chat Completions. Without it, **Edit** (Ctrl+I, or Cmd+I on macOS) sends its requests to `/completions`, which SinarCloud doesn't support.
* `roles` lists what Continue uses the model for: `chat` for Chat, Plan and Agent mode, `edit` for **Edit**, and `apply` for applying code from the chat to your files.
* `tool_use` under `capabilities` makes Continue send its tools, such as reading files and running commands, with each Agent request. Without it, Continue describes the tools in the prompt text instead.
* `contextLength` and `maxTokens` are the model's **Context window (tokens)** and **Maximum output (tokens)** from the **Models** page. Without `maxTokens`, Continue asks for replies of at most 4,096 tokens. SinarCloud refuses a `maxTokens` above the model's maximum.

If you chose another model, replace the alias, `name` and the two limits with its own. The model must list **Chat completions**, **Tool use** and **Streaming** under **Model capabilities**.

**6. Go back to the chat and check the model**

In the Continue panel, click **Back** to leave the settings. At the bottom of the chat box, the model menu now shows **DeepSeek V4.1 Flash**. If it shows another model, click it and choose **DeepSeek V4.1 Flash** under **Models**.

If the setup card with **API Key** and **Local** tabs is still under the chat box, close it with the close icon (X) in its top-right corner.

![The Continue chat panel with an empty chat box that reads Ask anything, '@' to add context. At the bottom of the box, the mode menu shows Agent, and the open model menu lists DeepSeek V4.1 Flash under Models, followed by Add Chat model and the hint Ctrl' to toggle model.](https://mintcdn.com/sinar-cloud/1ydOws_F7Drqtqre/images/integrations/continue-model-selector.png?fit=max\&auto=format\&n=1ydOws_F7Drqtqre\&q=85\&s=0da38f2fb46af8ff512aa77e4a7684bb)

DeepSeek V4.1 Flash in Continue's model menu

**7. Choose Agent mode**

Click the mode menu next to the model menu, and choose **Agent**. In **Agent** mode, Continue can use tools, such as reading and editing files and running commands. In **Chat**, Continue sends no tools. To see which tools a mode offers, hover over the info icon next to it: **All tools available** for **Agent**, and **Read-only/MCP tools available** for **Plan**.

Continue also shows a warning icon next to **Plan** and **Agent**. Its tooltip says **Agent might not work well with this model.** Continue shows it for every model whose name isn't on its own short list of recommended models. The warning doesn't change what Continue sends: in Agent mode, it still sends its tools with each request.

![The Continue chat box with the mode menu open. It lists Chat with the shortcut Ctrl L, Plan, and Agent with a check mark. Plan and Agent each have an info icon and a warning icon. Below them is the hint Ctrl . for next mode.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-mode-menu.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=9741ac509630a77b9a1229503249f189)

Agent selected in Continue's mode menu

**8. Send a prompt**

Click the chat box, type a task, for example `Add a GET /products/:id route to src/server.js`, and press Enter.

![The Continue chat box with the task Add a GET /products/:id route to src/server.js typed in. At the bottom of the box are the mode menu set to Agent, the model menu set to DeepSeek V4.1 Flash, and the Enter button.](https://mintcdn.com/sinar-cloud/ShOrAB8ikH3IKe3Y/images/integrations/continue-prompt.png?fit=max\&auto=format\&n=ShOrAB8ikH3IKe3Y\&q=85\&s=7f9717b496c04091f94799c69b9c4a02)

A task in the chat box, ready to send in Agent mode

Your first prompt in a session sends two requests: one for your prompt and one that names the session. Each follow-up in the same session sends the conversation so far, so start a new session for each new task. To start one, click the plus icon (**New Session**) at the top of the Continue panel.

**9. Find the requests in Usage**

In the console, under **AI**, click **Usage**, then choose the key you created for Continue in the **API key** filter. Only requests whose charge is final appear, so click **Refresh** if you don't see them yet.

![Log & Usage page with the Date range, Model and API key filters, a Refresh button and five cards of totals, starting with Total charged and Total saved. Below them are the Log, Summary, Spending, Models and Tokens tabs, with the Log tab's Recent requests table showing a Show details button on each row.](https://mintcdn.com/sinar-cloud/Zz311Jgf5s_A88RD/images/ai-usage.png?fit=max\&auto=format\&n=Zz311Jgf5s_A88RD\&q=85\&s=81c8d86294bf5b9247d4970ce519223f)

The Usage page, with the API key filter at the top

## Settings worth changing

### Session titles

After your first prompt in a session, Continue sends a second request to name the session. To skip it, click the gear icon at the top of the Continue panel, click **Settings**, and turn off **Enable Session Titles**.

![Continue's User Settings page with the Chat settings. Show Session Tabs, Wrap Codeblocks, Show Chat Scrollbar and Text-to-Speech Output are off. Enable Session Titles and Format Markdown are on.](https://mintcdn.com/sinar-cloud/1ydOws_F7Drqtqre/images/integrations/continue-session-titles.png?fit=max\&auto=format\&n=1ydOws_F7Drqtqre\&q=85\&s=97c1ff2e88992d59d881628b6ebb46a2)

Enable Session Titles in Continue's settings

### Autocomplete

The config above doesn't use the model for autocomplete, so Continue sends no requests while you type. If you add `autocomplete` to `roles`, Continue sends the code around your cursor to the model each time it suggests a completion, and each request is charged. Keep `useLegacyCompletionsEndpoint: false` if you do. Without it, autocomplete requests go to `/completions`, and Continue shows **Continue Autocomplete Error: HTTP 404 Not Found**.

## What works differently

* **You don't need a Continue account.** Continue runs on your local `config.yaml` without signing in.
* **Continue only knows the models in `config.yaml`.** It doesn't fetch the model list from SinarCloud. To use another model, add another entry under `models` with its alias, its own `name` and its limits.
* **Prompt caching settings don't apply.** Continue's `promptCaching` and `cacheBehavior` settings don't change the requests that `provider: openai` sends, so leave them out.

## Troubleshooting

Continue shows errors in a box titled **Error handling model response**. SinarCloud's message is under **View error output**.

> [accordion] 401 Invalid API key.
>
> Continue adds "This error usually happens when the API key is actually invalid." The key is missing, mistyped, expired, or revoked. Check that `SINARCLOUD_API_KEY` in `~/.continue/.env` holds your whole key. If the file doesn't set it, Continue sends the text `${{ secrets.SINARCLOUD_API_KEY }}` instead of a key. After you fix the file, open the Command Palette and run **Developer: Reload Window**. If the key has expired or been revoked, create a new one.
>
> Don't use **Check API key** in the error box. It opens OpenAI's website, because the model uses `provider: openai`.

> [accordion] 404 The requested inference endpoint is not supported.
>
> Continue sent the request to a path that SinarCloud doesn't serve. Check that `apiBase` in `config.yaml` is exactly `https://ai.sinarcloud.com/v1`. Continue adds `/chat/completions` to it, so don't add `/chat/completions` yourself. Then save the file.
>
> If you see this error when you use **Edit**, add `useLegacyCompletionsEndpoint: false` to the model in `config.yaml`, then save the file.
>
> If `apiBase` doesn't end in `/v1`, the message is `404 The requested endpoint does not exist.` instead. The fix is the same.

> [accordion] 404 The requested model does not exist or is not available for this endpoint.
>
> The model alias doesn't exist, the model isn't available right now, or it doesn't support chat completions. Copy the alias again from the **Models** page and check that `model` in `config.yaml` matches it exactly. Then check that the model's **Model capabilities** list **Chat completions**.

> [accordion] 400 The output-token limit exceeds the model's allowed range.
>
> `maxTokens` in `config.yaml` is higher than the model's **Maximum output (tokens)**, for example after you copied the entry for a model with a lower maximum. Set `maxTokens` to the model's maximum or lower, save the file, and send your message again.

> [accordion] Continue Autocomplete Error: HTTP 404 Not Found
>
> You added `autocomplete` to `roles` without `useLegacyCompletionsEndpoint: false`, so autocomplete requests go to `/completions`, which SinarCloud doesn't support. Add `useLegacyCompletionsEndpoint: false` to the model, or remove `autocomplete` from `roles`. See [Autocomplete](#autocomplete).

> [accordion] Your balance is empty or negative and no token credits remain for this model.
>
> SinarCloud refuses requests with this message when your balance is empty or negative and no token credits remain for the model. Continue's own text for this error may mention an OpenAI account, because the model uses `provider: openai`. It's about your SinarCloud balance. [Add balance](https://docs.sinarcloud.com/billing/top-up.md), then send your message again.

For other problems, see [Troubleshooting](https://docs.sinarcloud.com/help/troubleshooting.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.