Skip to main content

Aider

Aider is an open-source AI programming assistant that runs in the terminal. It supports multi-file editing and Git integration, and can directly modify local codebases through natural language conversation.

Prerequisites

  • You have activated a TCB environment and obtained the environment ID cloudBaseEnvID
  • Enable the required model in the AI console
  • Obtain the Base URL and API Key in the AI console
Base URLhttps://<ENV_ID>.api.tcloudbasegateway.com/v1/ai/cloudbase

codebuddy

Configuration Steps

Aider supports configuring custom models through environment variables or command-line parameters. CloudBase AI is compatible with the OpenAI protocol and can be accessed by using the openai prefix.

Configuration Field Mapping Table

Environment VariableDescription
OPENAI_API_BASEThe Base URL for the large model, which is obtained in the AI console.
OPENAI_API_KEYThe API Key for calling the large model, which is obtained in the AI console.
  1. Set the environment variables.

Mac/Linux (valid for the current terminal window)

export OPENAI_API_BASE="https://{{cloudBaseEnvID}}.api.tcloudbasegateway.com/v1/ai/cloudbase"
export OPENAI_API_KEY="eyJhbGciOiJSUzI1N..."

Windows CMD (valid for the current terminal window)

set OPENAI_API_BASE=https://{{cloudBaseEnvID}}.api.tcloudbasegateway.com/v1/ai/cloudbase
set OPENAI_API_KEY=eyJhbGciOiJSUzI1N...

Windows PowerShell (valid for the current terminal window)

$env:OPENAI_API_BASE = "https://{{cloudBaseEnvID}}.api.tcloudbasegateway.com/v1/ai/cloudbase"
$env:OPENAI_API_KEY = "eyJhbGciOiJSUzI1N..."
  1. Start up Aider and specify the model ID using the --model parameter.
aider --model openai/hy3-preview
note

The model ID must be prefixed with openai/ to indicate invocation via the OpenAI-compatible protocol. The large model ID is obtained from the model list in the AI console.