Cline on Qwen3.8 27B: Setup, a Measured Task and What It Cost
Published:
Cline works with any OpenAI-compatible API. In the CLI, run cline auth -p openai-compatible -m qwen38 -b https://api.heabsy.com/v1 -k <key>; in VS Code, choose the OpenAI Compatible provider with the same base URL and model ID and fill in Model Configuration. On a small Python task (five failing tests, error handling, one new test) Cline CLI with Qwen3.8 27B made 8 model calls and cost $0.042 at our catalog prices on 4 November 2026. 87% of the input came from the prompt cache; most of the cost was output, and most of the output was the model's reasoning.
Cline is a coding agent that runs in VS Code and in the terminal. It reads files, runs commands and edits code in a loop, and every turn of that loop is one request to the model. Any API that speaks the OpenAI Chat Completions format can be that model, so the same agent runs on an open-weight model such as Qwen3.8 27B.
This tutorial sets Cline up on Qwen3.8 27B through our API, first in the CLI and then in VS Code, and then runs one small task twice with every model call logged: how many calls it took, what came from the prompt cache, and which part of the bill was reasoning.
How do you connect the Cline CLI to an OpenAI-compatible API?
Install the CLI and store the provider with cline auth. For any OpenAI-compatible API the provider ID is openai-compatible:
npm install -g cline
cline auth -p openai-compatible -m qwen38 -b https://api.heabsy.com/v1 -k "$HEABSY_API_KEY"
cline auth writes the provider, model, base URL and key to ~/.cline/data/settings/providers.json. To keep the key out of that file, delete the apiKey field and pass the key as OPENAI_API_KEY in the environment instead.
Then run a task. With -y Cline approves every action and exits when it is done, which is what you want in a script or a CI job; -c sets the working directory:
cline -y -c ./my-project "Make the failing tests in tests/ pass without changing them"
cline -y --json -c ./my-project "..." # one JSON event per line, for scripts
The totals of a session, including tokens, are in ~/.cline/data/sessions/<id>/<id>.json. After a run the CLI leaves a background process, .cline --cline-hub-daemon; stop it at the end of a CI job.
How do you set it up in VS Code?
- Open Cline and click the gear icon.
- API Provider: OpenAI Compatible.
- Base URL:
https://api.heabsy.com/v1. Cline adds/chat/completionsitself; a base URL that already ends in it returns a 404. - API Key: your Heabsy key. Model ID:
qwen38. - Click Verify, then open Model Configuration.
For an OpenAI Compatible model, the extension starts from fixed defaults (a 128,000-token window, no prices, temperature 0) and uses whatever you enter instead:
| Field | Qwen3.8 27B (qwen38) |
MiMo V2.6 Flash (mimo-v26-flash) |
|---|---|---|
| Supports Images | on | on |
| Context Window Size | 1048576, or less (see below) | 1048576, or less |
| Max Output Tokens | 32768 | 65536 |
| Input Price / 1M tokens | 1.05 | 0.50 |
| Output Price / 1M tokens | 3.15 | 1.50 |
| Temperature | 1.0 | 1.0 |
Temperature 1.0 is what the developers recommend for both models: Qwen for Qwen3.8 27B in thinking mode (card), Xiaomi for MiMo V2.6 Flash (card). At temperature 0 Qwen3.8 27B can reason for a very long time: in the same test, Aider sent temperature 0 and one answer took 16,473 reasoning tokens.
To check the connection, ask Cline to list the files of your workspace. If it calls the tool and shows the list, the key, the base URL and tool calling all work, and the request appears in the Logs page of your console.
What did one task cost?
The task was a small Python module of our own, not an issue from a public project: durations.py turns strings like "2h30m" into seconds, and 5 of its 8 pytest tests failed (days, spaces between number and unit, upper-case units, a bare number, all of them together). Cline got one instruction: make all tests pass without changing them, add error handling for invalid input and one new test for it. We ran Cline CLI 3.0.74 twice on 4 November 2026, each time on a clean copy, then ran pytest ourselves, checked that the original tests were untouched and fed the parser invalid input.
| Run 1 | Run 2 | |
|---|---|---|
| Result | 9 passed, tests untouched, 1 new test | 9 passed, tests untouched, 1 new test |
| Model calls / tool calls | 8 / 13 | 9 / 11 |
| Input tokens, of them cached | 84,407, 73,735 (87%) | 86,594, 76,597 (88%) |
| Output tokens, of them reasoning | 7,798, 4,946 (63%) | 8,766, 5,832 (67%) |
| Largest single request | 16,503 tokens | 15,381 tokens |
| Cost at catalog prices | $0.0417 | $0.0442 |
| Wall-clock time | 48 s | 106 s |
Both runs did the same thing: added days, case-insensitive units, spaces and bare numbers, and raise ValueError on input such as "", "abc", "5x" or "2h-5m". The second run was slower because it ran at a busier time: the first token took 2–2.5 seconds instead of 0.3.
Where the $0.0417 of the first run went:
- Fresh input, $0.0112. 10,672 tokens: the first request and the new part of each later one.
- Cached input, $0.0059. 73,735 tokens of conversation that each request repeated from the one before.
- Output, $0.0246, of which reasoning $0.0156. The model thinks before each tool call, and that thinking is billed as output.
On a short task like this one the output decides the bill. On a long one the balance moves to input, because every call resends a conversation that keeps growing (see the context window section below).
Get an API key and run Cline on your own code: Qwen3.8 27B is free for 7 days, no card. After that you pay per token, and your first top-up gets $5 extra. Free requests run at lower priority at peak times.
Why does Cline show a different cost than the console?
Cline’s own numbers come out low:
- The CLI has no prices for a custom model, so it shows $0.
- The output counter leaves out reasoning. In the first run Cline reported 2,852 output tokens; the API billed 7,798.
- The VS Code extension has no cached-input price. Even with input and output prices entered, cached tokens count as free (Cline issue #13944), and in agent work most of the input is cached.
The usage block of every API response and the Logs page of the Heabsy console show what was billed.
Can you turn reasoning off?
Not from Cline. Qwen3.8 27B reasons by default, and Cline sends no reasoning parameter to an OpenAI Compatible model, so switching its thinking setting off does not change what the model does. Expect reasoning to be most of the output.
How does the context window affect the price?
Every call sends the whole conversation again, so a call costs more as the session grows. Cline keeps the conversation in check by compacting it, and the setup decides when that happens:
- Cline CLI gets no window from
cline auth. It runs with automatic compaction off and assumes 128,000 tokens only after the API rejects a request as too long. - The VS Code extension compacts when a request reaches 81% of the Context Window Size you entered (90% of 90% in its source code).
So the number you enter is also a ceiling on what one call can cost. Cost of one call at the compaction point, with 88% of the input cached and 1,000 tokens of output as in the runs above:
| Context Window Size | Compacts at | One call on Qwen3.8 27B |
|---|---|---|
| 128,000 (default) | 103,680 tokens | $0.0235 |
| 200,000 | 162,000 tokens | $0.0350 |
| 1,048,576 (full window) | 849,346 tokens | $0.1700 |
The largest request in our runs was 16,503 tokens and cost about $0.0064. A long session with the full window entered can reach calls 26 times that price before Cline compacts. A smaller window keeps calls cheap but compacts more often, and each compaction rewrites the history, so the call after it is billed at the fresh-input price. The cost formula behind these numbers is in What an agent step costs.
Should Plan and Act use different models?
Cline can switch the model with the mode (Settings → “Use different models for Plan and Act”). On a long task the switch has a price: the prompt cache belongs to one model, so the first call after switching pays the fresh-input price for the whole context. At 100,000 tokens on Qwen3.8 27B that call costs about $0.108 instead of $0.023. Use one model for both modes, or switch only when you start a new task.
What goes wrong, and how do you fix it?
| Symptom | Fix |
|---|---|
| 404 Not Found | The base URL must be exactly https://api.heabsy.com/v1, without /chat/completions. |
| 401 Unauthorized | The key is empty or has a trailing space. Paste it again from the console, or check OPENAI_API_KEY. |
| Cline shows $0 or a low cost | Expected: see the section on cost above. Trust the console. |
| A long CLI session fails with a context error | The CLI knows no window for a custom model and does not compact in advance. Start a new task for a new piece of work. |
| A CI job does not finish after Cline exits | Stop the .cline --cline-hub-daemon process at the end of the job. |
Where does your code go?
From Cline on your machine straight to api.heabsy.com. Qwen3.8 27B and MiMo V2.6 Flash run on GPUs we operate in the European Economic Area, and prompts and completions are not stored; we keep what billing needs: the model, the token counts and the time. The setup reference with the full model table is on the Cline integration page, and the same kind of measurement for Claude Code is in Run Claude Code on open models.
Method
- Prices: our model catalog on 4 November 2026 (Qwen3.8 27B): $1.05 input, $0.08 cached input, $3.15 output per million tokens.
- Runs: Cline CLI 3.0.74, model
qwen38onhttps://api.heabsy.com/v1, two runs on clean copies of the same module, run in parallel with other coding agents on 4 November 2026 between 10:02 and 10:13 UTC. - Counting: every request went through a logging proxy to our API; tokens are from the
usageblock of each response, cost is tokens times catalog prices. Cline was also checked directly against the API without the proxy. - Checks: pytest after each run, a comparison of the original tests before and after, and a separate set of invalid inputs the agent had not seen.