Cline with an OpenAI-compatible endpoint

Cline assumes OpenAI by default, but it ships a generic OpenAI-compatible provider whose only visible difference is one extra field. Fill it in and the extension stops caring which company serves the request — which also means you can move expensive tasks onto a cheaper model without reinstalling anything.

In short: Cline reveals its base URL field only when the provider is set to OpenAI Compatible. Agent loops are output-heavy, so the output rate — not the input rate most comparisons quote — decides the bill.

What you need

Confirm the key works first. One command, no SDK, costs nothing:
curl https://aicomp.ai/v1/models \
  -H "Authorization: Bearer sk-your-gateway-key"

A JSON list of model IDs means the key is good. Invalid token means it was copied wrong.

The setting that matters

FieldValueNotes
API ProviderOpenAI CompatibleThis is what reveals the base URL field at all.
Base URLhttps://aicomp.ai/v1Ends at /v1. The client appends the rest.
API KeyYour gateway keyPaste, do not retype — trailing spaces produce 401s.
Model IDExact stringTyped by hand if absent from the dropdown.

Menu labels differ between versions; field semantics do not. If your build words the provider differently, it is the one that unlocks a base URL.

Keep the values out of your editor state

Never paste either value into a project file — they end up in git history and then in a public repository. Export them in the shell you launch your editor from, so nothing sensitive lives in the workspace:

# In the shell you launch your editor from — not in a committed file
export GATEWAY_BASE_URL="https://aicomp.ai/v1"
export GATEWAY_API_KEY="sk-your-gateway-key"

# List what you can actually call, and copy IDs from here rather than typing them
curl -s "$GATEWAY_BASE_URL/models" \
  -H "Authorization: Bearer $GATEWAY_API_KEY" | jq -r '.data[].id' | head -40

Copy model IDs from that list rather than reconstructing them from memory. Vendor APIs reject unknown model strings outright — there is no fuzzy matching and no fallback to a similar model, which is why a typo looks like an outage.

Why the base URL must end at /v1

The field is a prefix, not a full address. Whatever you type, the client appends the resource path before sending — so the value has to stop before it:

# Correct — client appends /chat/completions to this prefix
https://aicomp.ai/v1            ->  https://aicomp.ai/v1/chat/completions   ✅

# Wrong — the path is now doubled, and every request 404s
https://aicomp.ai/v1/chat/completions
   ->  https://aicomp.ai/v1/chat/completions/chat/completions   ❌

# Wrong in the other direction — silently talks to OpenAI instead
(empty field)                   ->  https://api.openai.com/v1/...          ⚠️

The third case is the expensive one: it works. Requests succeed, tasks complete, and the bill lands somewhere you were not watching. This is exactly why confirming in your gateway usage log matters more than seeing a successful task.

Plan and Act burn tokens differently

Most agent extensions separate planning from acting, and that split is the cheapest control you have:

Why the agent workload changes the maths

An agent is not a chatbot. Each task reads files, writes a plan, edits, runs a command, reads the error and tries again — which is a mountain of output tokens relative to input. That is why the output rate decides the bill while the input rate everyone compares barely registers:

Cost of one heavy coding day (200k input / 60k output tokens) and a 20-day month. Rates checked 2026-09-20.
ModelVendorRate
in / out per 1M
Per dayPer month
gpt-5.6-lunaOpenAI$0.1 / $0.6$0.06$1
MiniMax-M3MiniMax$0.15 / $0.6$0.07$1
deepseek-v4-flashDeepSeek$0.22 / $0.66$0.08$2
gemini-3.7-flashGoogle$0.375 / $1.875$0.19$4
claude-haiku-4-5-20251001Anthropic$0.5 / $2.5$0.25$5
deepseek-v4-proDeepSeek$0.66 / $1.98$0.25$5
glm-5.3Zhipu$0.7 / $2.2$0.27$5
qwen3.8-maxAlibaba$1 / $3$0.38$8
claude-sonnet-5Anthropic$1 / $5$0.50$10
gpt-5.6-terraOpenAI$1 / $6$0.56$11
kimi-k3Moonshot$1.5 / $7.5$0.75$15
claude-opus-5Anthropic$2.5 / $12.5$1.25$25
Cost note. Agent loops multiply two things at once: tokens per task, and retries per task. The model choice above is worth real money at that shape of traffic, but the cheaper lever is usually narrower context — fewer files in scope means every iteration re-reads less.
You need a key before the code below runs. Create an account, generate a key, and copy the base URL (https://aicomp.ai/v1). Create one free →
Check current rates → Free to sign up · $1 minimum top-up · No prepayment

How this fails in practice

SymptomCauseFix
404 on every requestDoubled path from adding /chat/completions yourselfBase URL ends at /v1
No Base URL field visibleStill on a named vendor providerSwitch provider to OpenAI Compatible
401 immediatelyWhitespace in a hand-typed keyRe-paste; check for a stray newline
Works but bills the wrong accountEmpty field falling back to OpenAIConfirm the request appears in your gateway log
Model not selectableStatic dropdown, not a live catalogueType the ID from GET /models

FAQ

Where is the Base URL field?

It appears once the provider is set to OpenAI Compatible. Under a named provider the field is not shown, which is why people conclude the feature does not exist. Menu wording moves between versions — the provider choice is what matters.

My first task succeeded, so why is nothing in my usage log?

Either the override was not saved or the editor was not restarted. Some settings are read once at startup; a reload is enough in most builds, a full quit is sometimes required. Absence from your log is the only reliable signal.

Every request 404s.

Almost always a doubled path. The client appends the resource path to your base URL, so it must end at /v1. The opposite failure — leaving the field empty — sends requests to OpenAI instead, which is worse because it looks like it works.

My model is not in the list.

Type it. The list is a snapshot shipped with the extension, while your endpoint's catalogue changes whenever upstream does. The exact ID from GET /models is what gets billed.

Can I use one key across several tools?

Yes, and that is the practical reason to route through a gateway — one key, one bill, and spend visible per model instead of per vendor dashboard. Keep it out of any file that gets committed.

Related

Get API access