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

# Cline

> How to connect the Cline coding agent in VS Code to RuAPI via OpenAI Compatible mode and a custom Base URL

[Cline](https://cline.bot) is a VS Code extension — an autonomous coding agent that reads and edits files, runs commands, and works task by task. It connects to RuAPI through the **OpenAI Compatible** provider — one address opens every model.

## Prerequisites

<Steps>
  <Step title="RuAPI account and API key">
    Console → **Tokens** → create an `sk-...` key. The balance tops up in USDT — see [Top-up](/en/topup).
  </Step>

  <Step title="VS Code and the Cline extension">
    Install Cline from the VS Code Marketplace (or [cline.bot](https://cline.bot)) and open its icon in the sidebar.
  </Step>
</Steps>

## Setup

<Steps>
  <Step title="Open Cline settings">
    In the Cline panel, click ⚙️ → the provider selector (**API Provider**).
  </Step>

  <Step title="Choose OpenAI Compatible and fill the fields">
    | Field            | Value                                                          |
    | ---------------- | -------------------------------------------------------------- |
    | **API Provider** | `OpenAI Compatible`                                            |
    | **Base URL**     | `https://www.ruapi.ai/v1`  — **with** `/v1`                    |
    | **API Key**      | `sk-your-key`                                                  |
    | **Model ID**     | exact ID from the [pricing page](https://www.ruapi.ai/pricing) |
  </Step>

  <Step title="Save">
    Click **Done / Save**. Cline is ready.
  </Step>
</Steps>

<Tip>
  For agent work, pick a strong model — the Claude Sonnet or Claude Opus families hold up well across Cline's long, multi-step runs.
</Tip>

## First task

In Cline's input, describe a task, for example:

```
Add error handling to the parseConfig function in config.ts
```

Cline proposes a plan and edits. An entry in RuAPI Console → **Logs** confirms requests are going through RuAPI.

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 / Unauthorized">
    * The key must be a RuAPI token (`sk-...`).
    * Check that **OpenAI Compatible** is selected and the Base URL is `https://www.ruapi.ai/v1` with `/v1`.
  </Accordion>

  <Accordion title="Model not found / 404">
    The Model ID must match RuAPI verbatim. Exact names are on the [pricing page](https://www.ruapi.ai/pricing).
  </Accordion>

  <Accordion title="The agent burns through the balance fast">
    Cline sends a lot of context and many steps — tokens go faster than in plain chat. Create a separate key with a spend limit in Console → **Tokens**.
  </Accordion>
</AccordionGroup>
