openclaw models

Khám phá, quét và cấu hình model (model mặc định, fallbacks, auth profiles).

Liên quan:

Các lệnh thường dùng

openclaw models status
openclaw models list
openclaw models set <model-or-alias>
openclaw models scan

openclaw models status hiển thị model mặc định/fallbacks đã được xác định cùng với tổng quan về xác thực. Khi có provider usage snapshots, phần trạng thái OAuth/token sẽ bao gồm các provider usage headers. Thêm --probe để chạy live auth probes với từng provider profile đã cấu hình. Probes là các request thực (có thể tiêu tốn token và kích hoạt rate limits). Dùng --agent <id> để kiểm tra trạng thái model/auth của một agent đã cấu hình. Nếu bỏ qua, lệnh sẽ dùng OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR nếu được set, nếu không sẽ dùng agent mặc định đã cấu hình.

Lưu ý:

  • models set <model-or-alias> chấp nhận provider/model hoặc một alias.
  • Model refs được phân tích bằng cách tách ở dấu / đầu tiên. Nếu model ID có chứa / (kiểu OpenRouter), hãy thêm provider prefix (ví dụ: openrouter/moonshotai/kimi-k2).
  • Nếu các bạn bỏ qua provider, OpenClaw sẽ coi input là một alias hoặc một model cho provider mặc định (chỉ hoạt động khi không có / trong model ID).

models status

Các tùy chọn:

  • --json
  • --plain
  • --check (exit 1=expired/missing, 2=expiring)
  • --probe (live probe của các auth profiles đã cấu hình)
  • --probe-provider <name> (probe một provider)
  • --probe-profile <id> (lặp lại hoặc danh sách profile ids phân tách bằng dấu phẩy)
  • --probe-timeout <ms>
  • --probe-concurrency <n>
  • --probe-max-tokens <n>
  • --agent <id> (configured agent id; ghi đè OPENCLAW_AGENT_DIR/PI_CODING_AGENT_DIR)

Aliases + fallbacks

openclaw models aliases list
openclaw models fallbacks list

Auth profiles

openclaw models auth add
openclaw models auth login --provider <id>
openclaw models auth setup-token
openclaw models auth paste-token

models auth login chạy auth flow của provider plugin (OAuth/API key). Dùng openclaw plugins list để xem các provider nào đã được cài đặt.

Lưu ý:

  • setup-token yêu cầu nhập giá trị setup-token (tạo nó bằng claude setup-token trên bất kỳ máy nào).
  • paste-token chấp nhận một token string được tạo ở nơi khác hoặc từ automation.