GreenPT Docs
GreenPT Code

OpenCode

GreenPT is a built-in OpenCode provider. Sign in with opencode auth login and pick a model, no provider block required.

OpenCode is an open-source, terminal-native coding agent. GreenPT is one of its built-in providers, so the base URL, the adapter and the model list all ship with OpenCode. You sign in once and pick a model.

No config file needed

Earlier versions of this guide had you write a provider block into opencode.json. That is no longer necessary, and a hand-written block will shadow the built-in one. Delete any provider.greenpt entry you added previously.

Prerequisites

1. Sign in to GreenPT

opencode auth login

Choose GreenPT from the provider list, then paste your key. OpenCode writes it to ~/.local/share/opencode/auth.json. Inside a running session the same flow is the /connect command.

Prefer not to store the key on disk? Export it instead and skip this step:

export GREENPT_API_KEY="your-greenpt-key"

2. Pick a model

opencode              # then run /models and choose a GreenPT model

Every GreenPT model appears under the GreenPT provider, referenced as greenpt/<model-id>. To see the list without starting a session:

opencode models greenpt
glm-5.2z.aiFlagshipNew

GreenPT Code flagship coding model with strong reasoning, agentic tool-use, and multi-file software engineering performance. See the GreenPT Code guide for IDE setup. Also available as output-compression variants (glm-5.2-caveman, -honey, -ponytail) at the same price.

Tensor typeBF16 ยท F32
Released2026
Code generationAgentic coding tasksMulti-file reasoningTool use

Use it for: The default. Agentic, multi-file work across a large codebase.

kimi-k3Moonshot AINew

Moonshot Kimi K3, an open-weight 2.8T-parameter native multimodal agentic model with hybrid reasoning for long-horizon coding, knowledge work, and reasoning.

ReleasedJul 2026
ChatHybrid reasoningAgentic codingVision

Use it for: The hardest refactors and long-horizon agent runs.

deepseek-v4-flash-0731DeepSeekNew

DeepSeek V4 Flash, 2026-07-31 snapshot. A fast, low-cost reasoning model with a 1M-token context window and tool use. Reasoning is always on, so allow enough output budget for it.

ReleasedAug 2026
ChatReasoningTool useLong context

Use it for: Routine edits and test runs, at a fraction of the cost.

The picker holds the rest of the catalogue too. See Model Cards for every model and its price.

3. Pin a default (optional)

To fix one model for a repository, add an opencode.json in its root. This is the only config GreenPT needs, and it is entirely optional:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "greenpt/glm-5.2"
}

The same key works in the global config at ~/.config/opencode/opencode.json; a project file overrides it.

Verify the connection

A quick sanity check outside of OpenCode:

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

You should get back a list including glm-5.2. If this fails, fix the API key before troubleshooting inside OpenCode.

Troubleshooting

SymptomFix
GreenPT is missing from opencode auth loginUpdate OpenCode. The provider list comes from models.dev, which older builds cache
No GreenPT models under /modelsYou are signed out. Run opencode auth login, or set GREENPT_API_KEY in the shell OpenCode launches from
Authentication failedThe key is wrong or belongs to another environment. Test it with the curl command above
A stale model is offeredYour build's model list is behind ours. opencode models greenpt shows what OpenCode knows; /v1/models is the live truth
Config changes not applyingA project opencode.json overrides the global one. Check for a competing file in the repo root

On this page