开发者文档

从这些内容开始

搜索标题与正文↑ ↓ 选择 · Enter 打开 · Esc 关闭

CLI quick commands

Query models, run smoke tests, and check usage from coding assistants and terminals.

Overview

CLI quick commands make gateway checks available inside Claude Code, Codex CLI, shell aliases, and CI jobs without exposing secrets in prompts.

Environment

bash
export UOUODUO_BASE_URL="https://uouo.cloud/v1"
export UOUODUO_API_KEY="sk-xxx..."

Do not store real keys in shared dotfiles.

List models

bash
alias uo-models='curl -s "$UOUODUO_BASE_URL/models" -H "Authorization: Bearer $UOUODUO_API_KEY"'

With jq:

bash
uo-models | jq -r ".data[].id"

Smoke chat

bash
alias uo-chat='curl -s "$UOUODUO_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $UOUODUO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"gpt-4o-mini\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply with OK.\"}]}"'

Coding assistant usage

Add the command names to your project notes instead of pasting API keys into assistant context:

text
Before starting gateway work, run uo-models to confirm available models.
If it fails, check that UOUODUO_API_KEY is configured.

Safety tips

  • Never hardcode keys in aliases committed to Git.
  • Avoid commands that print full keys into terminal history.
  • Use one key per device or environment.
  • Revoke keys immediately when a device is lost.
CLI quick commands · uouo cloud