GreenPT Docs
GreenPT Code

Cline

Connect Cline, the autonomous VS Code coding agent, to GreenPT Code via its OpenAI Compatible provider.

Cline is an open-source autonomous coding agent for VS Code. It supports any OpenAI-compatible endpoint through its built-in OpenAI Compatible provider — no extension or plugin needed to use GreenPT.

Prerequisites

  • VS Code with the Cline extension installed
  • A GreenPT API key from your GreenPT dashboard

Setup

  1. Open Cline in VS Code and click the gear icon (settings) in the top-right corner.
  2. Configure the following fields:
FieldValue
API ProviderOpenAI Compatible
Base URLhttps://api.greenpt.ai/v1
API KeyYour GreenPT API key
Model IDglm-5.2 (or another model from the table below)
  1. Click Verify (if your Cline version shows it) to confirm the connection, then save.

Base URL must end at /v1

The Base URL must end at /v1 — do not paste the full /v1/chat/completions path. All four fields must belong to GreenPT; mixing a GreenPT key with another provider's URL returns a 401.

Available models

Model IDProviderCategoryInput (€/1M)Output (€/1M)Context
glm-5.2z.aiCoding€1.32€4.621M
minimax-m2.5MiniMaxCoding€0.17€0.99200k
kimi-k2.6Moonshot AICoding€0.83€3.85256k

Model IDs are case-sensitive and must exactly match what GreenPT's /v1/models endpoint returns.

In the same settings panel, Cline's Model Configuration section lets you set advanced parameters per model. Two are worth setting for accurate cost tracking and context management:

  • Context window — set to the model's context size (e.g. 1,000,000 for glm-5.2) so Cline manages its context budget correctly.
  • Input/Output price — enter GreenPT's per-million-token prices from the table above so Cline's cost display matches your actual GreenPT billing.

Verify the connection

Quick sanity check outside of Cline:

curl https://api.greenpt.ai/v1/models \
  -H "Authorization: Bearer YOUR_GREENPT_KEY"

You should get back a list including the model IDs above. If this fails, fix the API key or endpoint before troubleshooting inside Cline.

Troubleshooting

SymptomFix
"Invalid API Key" (401)Confirm the key is a GreenPT key and matches the GreenPT Base URL — all fields must come from the same provider
"Model Not Found" (404)Model ID must exactly match an ID from GreenPT's /v1/models response, including case
Connection errorsCheck the Base URL ends in /v1 (not /v1/chat/completions), and that the endpoint is reachable from your network
Unexpected output/behaviorTry another model from the table, and double-check the Model Configuration parameters

UI labels vary by version

Cline's UI labels can shift slightly between versions — if a field name doesn't match exactly, look for its equivalent in the provider settings panel.

Roadmap note: first-class provider listing

The OpenAI Compatible route above works today with zero changes on Cline's side. For a first-class GreenPT entry in Cline's provider dropdown, Cline's preferred path is a community provider package on the Vercel AI SDK (an @greenpt/ai-sdk-provider npm package). Once published, GreenPT can be proposed as a native provider — users would then select "GreenPT" directly instead of configuring the generic OpenAI Compatible option.

On this page