GreenPT Docs
GreenPT Code

Aider

Connect Aider, the terminal AI pair programmer, to GreenPT Code via the openai/ model prefix.

Aider is an open-source AI pair programmer for the terminal, with tight git integration. It connects to any OpenAI-compatible endpoint via environment variables — GreenPT works out of the box using the openai/ model prefix.

Prerequisites

  • Aider installed (python -m pip install aider-install && aider-install)
  • A GreenPT API key from your GreenPT dashboard

Quick start

export OPENAI_API_BASE=https://api.greenpt.ai/v1
export OPENAI_API_KEY=your-greenpt-key
aider --model openai/glm-5.3

The openai/ prefix tells Aider (via LiteLLM) to treat GreenPT as an OpenAI-compatible endpoint. The part after the prefix must exactly match a model ID from GreenPT's /v1/models endpoint.

Use openai/glm-5.3 as the default and openai/deepseek-v4.1-flash for quick, low-cost edits.

glm-5.3z.aiFlagship

The newest z.ai flagship reasoning model, successor to glm-5.2, with agentic tool-use at the same price.

Input€1.10
Cached input€0.275
Output€4.40
Context1M
ReleasedAug 2026
ChatReasoningTool useAgentic coding

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

deepseek-v4.1-flashDeepSeek

DeepSeek V4.1 Flash, a multimodal reasoning model with a 1M-token context window for chat and agentic coding.

Input€0.22
Cached input€0.011
Output€1.10
Context1M
ReleasedSep 2026
ChatReasoningVisionLong context

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

Persistent configuration

Instead of flags and exports, put your defaults in ~/.aider.conf.yml (global) or .aider.conf.yml in the repo root (project — takes precedence):

openai-api-base: https://api.greenpt.ai/v1
model: openai/glm-5.3

Keep the API key out of the YAML file — set it in your shell profile or a .env file in the repo root:

# .env
OPENAI_API_BASE=https://api.greenpt.ai/v1
OPENAI_API_KEY=your-greenpt-key

Model metadata (context window & pricing)

Aider warns about unknown models because GreenPT's model IDs aren't in LiteLLM's built-in database. Register them in ~/.aider.model.metadata.json so Aider knows each model's context window and shows accurate costs in-session:

{
  "openai/glm-5.3": {
    "max_input_tokens": 1000000,
    "input_cost_per_token": 0.0000011,
    "output_cost_per_token": 0.0000044,
    "litellm_provider": "openai",
    "mode": "chat"
  },
  "openai/deepseek-v4.1-flash": {
    "max_input_tokens": 1000000,
    "input_cost_per_token": 0.00000022,
    "output_cost_per_token": 0.0000011,
    "litellm_provider": "openai",
    "mode": "chat"
  }
}

Costs are per single token (price per million ÷ 1,000,000), at the EU rates on Model Cards. Add max_output_tokens only if you want Aider to cap replies.

For strong coding models like these, Aider's diff edit format is usually the most token-efficient. Set it per model in ~/.aider.model.settings.yml:

- name: openai/glm-5.3
  edit_format: diff
  use_repo_map: true
- name: openai/deepseek-v4.1-flash
  edit_format: diff
  use_repo_map: true

If a model produces malformed diffs, fall back to edit_format: whole.

Verify the connection

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

You should get back a list including the model IDs above.

Troubleshooting

SymptomFix
"Unknown model" warningExpected for custom providers — silence it by adding the model to ~/.aider.model.metadata.json as shown above
401 UnauthorizedConfirm OPENAI_API_KEY holds your GreenPT key and is exported in the shell running Aider
404 / model not foundModel string must be openai/ + the exact ID from GreenPT's /v1/models (case-sensitive)
Requests going to api.openai.comOPENAI_API_BASE isn't set in the current shell — re-export it or use the .env / YAML config
Malformed editsSwitch that model's edit_format to whole in .aider.model.settings.yml

On this page