Pi Coding Agent

Pi Coding Agent is a lightweight CLI AI coding assistant. Configure it to use Unisound MaaS models with pay-as-you-go or U Plan.

1. Preparation

Before connecting an AI tool, complete the following preparation steps.

1. Get an API Key

The platform supports pay-as-you-go and U Plan. Credentials differ by billing mode:

Usage
Description
How to get credentials (API Key examples below)
Pay-as-you-go API
Billed by usage; suitable for light use
  • Base URL OpenAI-compatible: https://maas-api.unisound.com/v1 Anthropic-compatible: https://maas-api.unisound.com/anthropic
  • API Key
  • Format: sk-xxxxx

Go to API Key Management to create an API Key

U Plan
Fixed subscription fee with plan quotas
  • Base URL OpenAI-compatible: https://maas-api.unisound.com/v1 Anthropic-compatible: https://maas-api.unisound.com/anthropic
  • API Key
  • Format: tp-xxxxx

After successfully subscribing to U Plan, go to Subscription Management to get your dedicated API Key

Pay-as-you-go supports all modalities, including text, speech, and vision.

A plan-exclusive Key is for plan quota. It may exist before paid resources are available; you can use resources only when you have plan quota. See U Plan overview.

2. Install Pi Coding Agent

  1. Install or update Node.js (v22.19 or later).
  2. Run the following command in a terminal to install Pi Coding Agent.
Bash
npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Verify the install. A version number means success.

Bash
pi --version

3. Configure credentials

Create or edit ~/.pi/agent/models.json (Windows: C:\\Users\\<username>\\.pi\\agent\\models.json) and write the following config.

Replace UNISOUND_API_KEY with your API Key.

JSON
{
  "providers": {
    "unisound": {
      "baseUrl": "https://maas-api.unisound.com/v1",
      "api": "openai-completions",
      "apiKey": "UNISOUND_API_KEY",
      "models": [
        {
          "id": "u2-flash",
          "name": "U2-Flash"
        }
      ]
    }
  }
}

To adjust context and output limits, add contextWindow and maxTokens on the model using the target model docs.

See Preparation for how to obtain an API Key and its format.

Save the file, run pi in your project, then use /model (or Ctrl+L) to pick a unisound model. Press Ctrl+S to save it as default.

Pi Coding Agent model picker screenshot

4. Quick access to capability models

We provide U2-ASR, U2-TTS, U2-TTS-Clone, and U2-OCR capabilities. Add the matching model Skill in Pi Coding Agent to call these services without integrating each model API separately.

Open a Skill page below to install via chat or CLI. After installation, the Skill guides you through model configuration.

Model
Skill Name
Skill Description
Action
U2-OCR
u1-ocr-parser-pro
Document Parsing
U2-OCR
u1-ocr-extract-pro
Document Information Extraction and Classification
U2-OCR-Med
u1-ocr-med-pro
Medical Document Information Extraction and Classification
U2-ASR
u2-asr-pro
Speech Transcription
U2-TTS
u2-tts-pro
Speech Synthesis
U2-TTS-Clone
u2-tts-clone-pro
Voice Cloning