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

# Cline & Roo Code

> Configure an OpenAI-compatible provider (or Anthropic with a custom base URL) in Cline and Roo Code to use Hostlinku models

[Cline](https://cline.bot) - along with its fork, **Roo Code** - provides an **OpenAI-compatible** provider that accepts a base URL, API key, and any model ID. That’s the simplest route for Hostlinku; an alternative route via the **Anthropic** provider is discussed below. Using **Kilo Code**? See the specific guide at [Kilo Code](https://docs.hostlinku.com/en/integrations/kilo-code.md).

### Open the carrier settings

In the Cline panel, click the gear icon (**Settings**) → **API Configuration**.

When Cline first opens, it displays the screen *How will you use Cline?* - select **Bring my own API key**, then **Continue**.

![Cline home screen: "Bring my own API key" option selected](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/cline-setup.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=2aefc2fdbd11d1c601ff8dfd45365b43)

### Select "OpenAI Compatible" and fill in the fields

| Field | Value |
| - | - |
| **API Provider** | `OpenAI Compatible` |
| **Base URL** | `https://api.hostlinku.com/v1` |
| **API Key** | `sk-…` (Hostlinku API key) |
| **Model ID** | slug from the [catalog](https://docs.hostlinku.com/en/models.md), e.g., `claude-sonnet-4-6` |

![Cline: OpenAI-Compatible API Provider with Base URL https://api.hostlinku.com/v1](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/cline-openai.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=2f8890c547b571b9a878fd507635d81a)

### (Recommended) Complete the Configuration Model

Open the **Model Configuration** section so that Cline can manage the context and prices correctly:

* **Supports Images**: Check this box for vision models (`claude-sonnet-4-6`, `gpt-5-5`).
* **Context Window Size**: `context_window` from the catalog (e.g., `1000000`).
* **Max Output Tokens**: `64000` is a safe value for large models.
* **Input/Output Price**: Copy from the `pricing` catalog if you want an accurate estimate of Cline's costs;
  The actual bill is the one recorded in the console.

  ![Complete Cline API Configuration Panel: Hostlinku Base URL, API Key, Model ID, Model Configuration](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/cline-byok-openai.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=9b6e74504d9816cb77ca26c9c98b7467)

### Verification

Click **Done**, submit a small task (*"a brief README for this repo"*). The request appears in the console → **Request Log**.

## Plan/Act Mode with Different Models

Cline can use different models for the **Plan** and **Act** modes. A common cost-effective combination: **Plan** = `claude-opus-4-6` or `gpt-5-5` (reasoning), **Act** = `claude-sonnet-4-6` or `deepseek-v4-flash` (execution). Enable *"Use different models for Plan and Act modes"* in the settings, then enter the same provider profile with different model IDs.

## Alternative: Anthropic

Cline also has a provider called **Anthropic** with a *Use custom base URL* option. Enter `https://api.hostlinku.com` (without `/v1`) and your Hostlinku API key. The difference: the list of models for this provider is **limited to IDs recognized by Cline**-select a Claude model whose slug matches the one in the Hostlinku catalog (e.g., `claude-sonnet-4-6`, `claude-haiku-4-5`). For non-Claude models or slugs not listed, use **OpenAI Compatible**.

![Cline: Anthropic provider with "Use custom base URL" set to https://api.hostlinku.com](https://mintcdn.com/hostlinku/wMpi8klIZneDqj3k/images/integrations/cline-anthropic.webp?fit=max\&auto=format\&n=wMpi8klIZneDqj3k\&q=85\&s=aef9e9b6ff4d7f2c37eee35c591c6bc1)

Prompt caching

Through the Anthropic route, Cline sends `cache_control`, and Hostlinku forwards it-the cache token is reported in `cache_read_input_tokens` and billed at the model cache rate. Through the OpenAI Compatible route, caching is handled automatically by models that support it.

## Cline CLI

```bash theme={null}
cline auth -p openai -k "$HOSTLINKU_API_KEY" -b https://api.hostlinku.com/v1
cline --model claude-sonnet-4-6 "tambahkan validasi input di handler login"
```

## Troubleshooting

* **`401`** - Invalid or revoked key. In Roo Code, make sure the key is entered in the **profile** of the provider that is currently
  active, not another profile.
* **`404 model_not_found`** - Incorrect model ID; copy it from `GET /v1/models`.
* **`404` on all requests** - the base URL is missing `/v1` (OpenAI path) or actually uses `/v1` in
  Anthropic path. Compare it to the screenshot above.
* **Empty response in Act mode** - a model without *tool calling*. Use a model from the recommendations in
  [Overview](https://docs.hostlinku.com/en/integrations.md).
* **Context runs out quickly** - set the *Context Window Size* according to the catalog so that Cline truncates the history
  correctly.


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