Settings

Account

Account Info

User ID:

Records:

Change Username

⚠️ Security Alert: Your password may not meet the latest security requirements

New policy requires passwords to include letters, digits, and special characters. We recommend updating your password for better account security.

Change Password

Data

Cloud Backup

Max 5 backups

No backups

Benefits & Points

Record Quota

Used: / records

Default quota: 2000 records. Redeem code ly2026 to upgrade to 2500 + 500 points

✓ Verified, full quota

Balance

Daily Tasks

Features

🤖 OCR AI Enhancement

Use GLM-4V vision model when EasyOCR fails (costs 15 points)

Developer

🔑 API Access Key

Generate an API key to record transactions from the terminal. The key is shown only once — save it securely.

📖 How to Call the API

After setting your API Key, use curl or scripts in the terminal to call the ledger API. Cross-platform:

① Set Environment Variables

# Add to ~/.bashrc or ~/.zshrc
export LEDGER_KEY="你的API密钥"
export LEDGER_HOST="https://lycheeledger.cn"

② Record an Expense

curl -s -X POST "$LEDGER_HOST/api/v1/ledger/sync/upload" \
  -H "X-API-Key: $LEDGER_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"device_id\":\"cli\",\"records\":[{\"client_id\":$(date +%s),\"date\":\"$(date +%Y-%m-%d)\",\"category\":\"餐饮\",\"amount\":-35,\"note\":\"外卖\",\"modified_ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}]}"

③ Record Income

curl -s -X POST "$LEDGER_HOST/api/v1/ledger/sync/upload" \
  -H "X-API-Key: $LEDGER_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"device_id\":\"cli\",\"records\":[{\"client_id\":$(date +%s),\"date\":\"$(date +%Y-%m-%d)\",\"category\":\"工资\",\"amount\":8000,\"note\":\"本月\",\"modified_ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"}]}"

④ View All Records

curl -s "$LEDGER_HOST/api/v1/ledger/sync/all" -H "X-API-Key: $LEDGER_KEY" | python3 -m json.tool

⑤ Delete Records

curl -s -X POST "$LEDGER_HOST/api/v1/ledger/sync/batch-delete" \
  -H "X-API-Key: $LEDGER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"device_id":"cli","client_ids":[ID1,ID2]}'

① Set Environment Variables

:: Temporary (current CMD window)
set LEDGER_KEY=你的API密钥
set LEDGER_HOST=https://lycheeledger.cn

:: Permanent: setx LEDGER_KEY "your-key" (restart CMD)
::
:: ⚠️ Change client_id before each entry to avoid overwriting: %RANDOM%%RANDOM% generates 0~1B random number

② Record an Expense

:: Change C_ID before each run, or use set /a C_ID=%RANDOM%%RANDOM% to auto-generate
set C_ID=1

curl -s -X POST "%LEDGER_HOST%/api/v1/ledger/sync/upload" ^
  -H "X-API-Key: %LEDGER_KEY%" ^
  -H "Content-Type: application/json" ^
  -d "{\"device_id\":\"cli\",\"records\":[{\"client_id\":%C_ID%,\"date\":\"2026-07-16\",\"category\":\"餐饮\",\"amount\":-35,\"note\":\"外卖\",\"modified_ts\":\"2026-07-16T12:00:00Z\"}]}"

③ Record Income

set /a C_ID=%RANDOM%%RANDOM%

curl -s -X POST "%LEDGER_HOST%/api/v1/ledger/sync/upload" ^
  -H "X-API-Key: %LEDGER_KEY%" ^
  -H "Content-Type: application/json" ^
  -d "{\"device_id\":\"cli\",\"records\":[{\"client_id\":%C_ID%,\"date\":\"2026-07-16\",\"category\":\"工资\",\"amount\":8000,\"note\":\"本月\",\"modified_ts\":\"2026-07-16T12:00:00Z\"}]}"

④ View All Records

curl -s "%LEDGER_HOST%/api/v1/ledger/sync/all" -H "X-API-Key: %LEDGER_KEY%"

⑤ Delete Records

:: Replace 1,2 with the client_id values you found
curl -s -X POST "%LEDGER_HOST%/api/v1/ledger/sync/batch-delete" ^
  -H "X-API-Key: %LEDGER_KEY%" ^
  -H "Content-Type: application/json" ^
  -d "{\"device_id\":\"cli\",\"client_ids\":[1,2]}"

① Set Environment Variables

# Current session
$env:LEDGER_KEY="你的API密钥"
$env:LEDGER_HOST="https://lycheeledger.cn"

# Permanent: [Environment]::SetEnvironmentVariable("LEDGER_KEY","your-key","User")

② Record an Expense

$body = @{
  device_id="cli"
  records=@(@{
    client_id=(Get-Date -UFormat %s)
    date=(Get-Date -Format "yyyy-MM-dd")
    category="餐饮"
    amount=-35
    note="外卖"
    modified_ts=(Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ")
  })
} | ConvertTo-Json -Compress

Invoke-RestMethod -Uri "$env:LEDGER_HOST/api/v1/ledger/sync/upload" `
  -Method Post `
  -Headers @{"X-API-Key"=$env:LEDGER_KEY} `
  -ContentType "application/json" `
  -Body $body

④ View All Records

Invoke-RestMethod -Uri "$env:LEDGER_HOST/api/v1/ledger/sync/all" `
  -Headers @{"X-API-Key"=$env:LEDGER_KEY} | ConvertTo-Json -Depth 10

⑤ Delete Records

$body = '{"device_id":"cli","client_ids":[1,2]}'
Invoke-RestMethod -Uri "$env:LEDGER_HOST/api/v1/ledger/sync/batch-delete" `
  -Method Post `
  -Headers @{"X-API-Key"=$env:LEDGER_KEY} `
  -ContentType "application/json" `
  -Body $body

💡 API Key is limited to recording/querying/deleting. Cannot change passwords or access AI features. Shown only once after generation.
📋 amount: negative=expense, positive=income; client_id must be unique each time, duplicates will overwrite the previous record.

📥 Download API Skill (for AI Agents)

About

About

荔枝记账 v1.0.0

Lightweight cloud bookkeeping service

SSR · Fast Loading · E2E Encrypted

View Disclaimer & Terms of Service

Continue to account deletion