All Products
Search
Document Center

Alibaba Cloud Model Studio:Configuration & Tools

Last Updated:Nov 05, 2026

Bailian CLI command reference for auth configuration, profile management, model marketplace, file upload, and general tools.

Manage CLI authentication, switch profiles, browse the model marketplace, upload files, and use general tools from the terminal.

ImportantAppend --help to any command for full parameter details, e.g. bl config show --help. Every parameter that accepts a file URL also accepts a local path — the CLI auto-uploads it to temporary storage (valid for 48 hours), so you never need to host files as URLs yourself. Command details on this page are verified against bl 2.8.0. Global flags can precede the full command path, for example bl --config token-plan auth status; command-specific and credential flags must still follow the command path.

Authentication

bl auth login

Authenticate with API key, console browser login, or OpenAPI AK/SK (credentials can coexist). No authentication required.

Usage

bl auth login --api-key <key> | --console [--no-browser | --token-stdin --console-region <region>] | --open-api --access-key-id <id> --access-key-secret <secret>
ParameterTypeRequiredDescription
--api-key <key>stringnoModel API key to validate and store
--base-url <url>stringnoModel API base URL to validate and store with --api-key
--consoleswitchnoSign in via browser (China by default; use --console-site international for the international site). Creates an ordinary API key if needed; subscription plans require --api-key
--no-browserswitchnoWith --console, print the login URL without opening a browser
--token-stdinswitchnoWith --console, read and validate one console access token from stdin; requires --console-region, and does not open a browser or local server
--console-region <region>stringnoConsole gateway region, e.g. cn-beijing or ap-southeast-1
--console-site <site>stringnoConsole site: domestic, international
--open-apiswitchnoStore Alibaba Cloud OpenAPI AK/SK credentials
--access-key-id <id>stringnoAlibaba Cloud Access Key ID to store
--access-key-secret <secret>stringnoAlibaba Cloud Access Key Secret to store

Example: Authenticate via browser login for console

bl auth login --console --console-site international
  • When a browser cannot be opened, use bl auth login --console --console-site international --no-browser to print the login URL, or import an access token from stdin with --token-stdin.

  • OpenAPI AK/SK is resolved as a complete group in this order: command parameters, BAILIAN_ACCESS_KEY_ID / BAILIAN_ACCESS_KEY_SECRET, Bailian configuration, then ALIBABA_CLOUD_ACCESS_KEY_ID / ALIBABA_CLOUD_ACCESS_KEY_SECRET. Fields are not combined across sources. STS tokens come from the same source: BAILIAN_SECURITY_TOKEN, the security_token config key, or ALIBABA_CLOUD_SECURITY_TOKEN.

  • Console business commands do not accept temporary AK/SK flags. When a console token is missing or expired, the CLI obtains one automatically with available AK/SK, exchanging at most once per request.

bl auth status

Show current authentication state. No authentication required.

Usage

bl auth status

This command only supports global flags.

Example: Show authentication status with JSON output

bl auth status --output json

bl auth logout

Clear stored credentials; full logout also clears the model Base URL. No authentication required.

Usage

bl auth logout [--console | --open-api] [--dry-run]
ParameterTypeRequiredDescription
--consoleswitchnoOnly clear the console access_token, keep api_key intact
--open-apiswitchnoOnly clear OpenAPI AK/SK/STS credentials, keep other credentials intact

Example: Clear console access_token only

bl auth logout --console

bl auth generate-access-token

Generate a CLI access token using OpenAPI AK/SK. No authentication required.

Usage

bl auth generate-access-token --access-key-id <id> --access-key-secret <secret> --security-token <token>
ParameterTypeRequiredDescription
--access-key-id <id>stringyesAlibaba Cloud Access Key ID
--access-key-secret <secret>stringyesAlibaba Cloud Access Key Secret
--security-token <token>stringnoAlibaba Cloud STS Security Token to store (optional)

Example: Generate CLI access token with AK/SK and optional STS token

bl auth generate-access-token --access-key-id LTAIxxxxx --access-key-secret xxxxx --security-token <token>

Configuration

bl config set

Set a config value. No authentication required.

Usage

bl config set --key <key> --value <value>
ParameterTypeRequiredDescription
--key <key>stringyesConfig key (language, base_url, output, output_dir, timeout, watermark, api_key, api_key_capabilities, access_token, access_key_id, access_key_secret, security_token, default_*_model, workspace_id)
--value <value>stringyesValue to set

Example: Set configuration key language to zh-CN

bl config set --key language --value zh-CN

bl config show

Display current configuration. No authentication required.

Usage

bl config show

This command only supports global flags.

Example: Show current configuration in JSON output

bl config show --output json
  • Shows the effective sources of the API Key and Base URL and warns when requests use values from different configuration sources.

bl config list

List config profiles and show the active profile. No authentication required.

Usage

bl config list

This command only supports global flags.

Example: List config profiles with active profile in JSON output

bl config list --output json

bl config use

Set the active config profile. No authentication required.

Usage

bl config use --name <name>
ParameterTypeRequiredDescription
--name <name>stringyesExisting profile name, or default

Example: Set active config profile to token-plan

bl config use --name token-plan

bl config ui

Open a local web UI to manage config profiles. No authentication required.

Usage

bl config ui [--port <port>] [--no-open]
ParameterTypeRequiredDescription
--port <port>numbernoPort to listen on (default: random free port)
--no-openswitchnoDo not open the browser automatically

Example: Open config management web UI on port 8787

bl config ui --port 8787

bl config agent

Configure a coding agent to use DashScope API. No authentication required.

Usage

bl config agent --agent <name> (--base-url <url> | --region <region>) (--api-key <key> | --key <encoded>) --model <model>
ParameterTypeRequiredDescription
--agent <name>stringyesTarget agent: claude-code, qwen-code, opencode, openclaw, hermes, codex, pi
--base-url <url>stringnoAPI base URL
--region <region>stringnoModel Studio region (e.g. cn-beijing, ap-southeast-1); converted into --base-url. Token Plan only
--api-key <key>stringnoAPI key
--key <encoded>stringnoObfuscated API key from the web console (starts with "o1_"); decoded into --api-key
--model <model>stringyesDefault model name
--context-window <tokens>numbernoOpenClaw only: model context window in tokens (default: 256000)
--wire-api <api>stringnoCodex only: wire protocol (default: responses). "chat" only works with legacy Codex <= 0.80.0

Example: Configure coding agent to use DashScope API with specified settings

bl config agent --agent claude-code --base-url https://dashscope-intl.aliyuncs.com/apps/anthropic --api-key sk-xxxxx --model qwen3-max

Output and diagnostics

The default output format is text. Switch to JSON with --output json, DASHSCOPE_OUTPUT=json, or the output config key.

  • JSON mode returns the complete business result on stdout. Warnings, diagnostics, and errors are written separately to stderr as JSONL so scripts and Agents can parse them independently.
  • Quiet mode hides only progress and informational messages while preserving complete results, warnings, and errors. Set DASHSCOPE_QUIET=1 to enable quiet. Scripts that extracted IDs, paths, or answers from quiet output must read JSON fields instead.
  • --introspect prints the machine-readable command schema (JSON) and exits, so Agents can discover commands and parameters.
  • Interactive login, the local config UI, and Pipeline event streams use text output. To request JSON for streaming speech output, specify a file with --out.

General tools

bl file upload

Upload a local file to DashScope temporary storage (48h). Requires API Key authentication.

Usage

bl file upload --file <path> --model <model>
ParameterTypeRequiredDescription
--file <path>stringyesLocal file to upload (image, video, audio)
--model <model>stringyesTarget model name (file is bound to this model)

Example: Upload photo.jpg to DashScope storage bound to qwen3-vl-plus model

bl file upload --file photo.jpg --model qwen3-vl-plus
  • The upload service is selected from the active model endpoint. Official temporary uploads support only the Beijing and Singapore regions; unsupported regions and Token Plan fail explicitly.
  • An explicitly specified custom upload proxy is no longer rejected based on the key type.
  • Uploads to temporary OSS follow --timeout.

bl model list

Browse model families or show detailed model info in the Bailian model marketplace. No authentication required.

Usage

bl model list [--model <model>] [--page <n>] [--page-size <n>] [--provider <p>] [--capability <c>] [--feature <f>] [--input-modality <m>] [--output-modality <m>] [--include-deprecated] [--enrich]
ParameterTypeRequiredDescription
--model <model>stringnoShow full details of a specific model family (switches to detail mode)
--page <n>numbernoPage number (default: 1)
--page-size <n>numbernoResults per page (default: 10)
--provider <p>arraynoFilter by provider (repeatable, e.g. --provider alibaba --provider deepseek)
--capability <c>arraynoFilter by capability code (TG, Reasoning, VU, IG, VG, TTS, ASR, …)
--feature <f>arraynoFilter by feature (function-calling, web-search, structured-outputs, …)
--context-window <w>arraynoFilter by context window range bucket
--input-modality <m>arraynoRequire an input modality (repeatable: Text, Image, Video, Audio)
--output-modality <m>arraynoRequire an output modality (repeatable: Text, Image, Video, Audio)
--include-deprecatedswitchnoInclude models that are already offline (hidden by default)
--enrichswitchnoAlso fetch input parameter schema (predictConfig) for trunk models (detail mode only)

Example: List models provided by alibaba

bl model list --provider alibaba
  • Both the catalog and --enrich parameter-schema endpoints are public — no console login needed.
  • Browse mode hides models that are already offline; use --include-deprecated to include them. Detail mode (--model) always lists every version and flags its status instead.

Search the model catalog by keyword, ranked by relevance. No authentication required.

Usage

bl model search --keyword <kw> [--limit <n>] [--provider <p>...] [--capability <c>...] [--feature <f>...] [--context-window <w>...] [--input-modality <m>...] [--output-modality <m>...] [--include-deprecated]
ParameterTypeRequiredDescription
--keyword <kw>stringyesKeyword matched against model ID, name, capabilities, features, and description
--limit <n>numbernoMaximum results to return (default: 20)
--provider <p>arraynoFilter by provider (repeatable, e.g. --provider alibaba --provider deepseek)
--capability <c>arraynoFilter by capability code (TG, Reasoning, VU, IG, VG, TTS, ASR, and more)
--feature <f>arraynoFilter by feature (function-calling, web-search, structured-outputs, and more)
--context-window <w>arraynoFilter by context-window range bucket
--input-modality <m>arraynoRequire an input modality (Text, Image, Video, Audio)
--output-modality <m>arraynoRequire an output modality (Text, Image, Video, Audio)
--include-deprecatedswitchnoInclude models that are already offline

Example: Search for models with qwen in the name

bl model search --keyword qwen
  • Search scans the whole catalog but hides offline models by default; pass --include-deprecated to include them.
  • The model catalog endpoint is public; no console login is needed.

bl model code

Print a ready-to-run SDK sample for calling a model. No authentication required.

Usage

bl model code --model <model> [--sdk <sdk>] [--api <style>] [--lang <lang>]
ParameterTypeRequiredDescription
--model <model>stringyesModel to generate a sample for
--sdk <sdk>stringnoSDK flavour: openai (default) or dashscope
--api <style>stringnoAPI style: completions (default) or responses
--lang <lang>stringnoLanguage of the snippet (default: python); pass an unsupported value to list available options

Example: Generate a Python sample for qwen-max

bl model code --model qwen-max

Example: Generate a curl sample for qwen-max

bl model code --model qwen-max --lang curl
  • Text output is the snippet alone, so it can be redirected straight into a file; use --output json for the snippet plus metadata.
  • The sample base URL contains a [workspace-id] placeholder. Replace it, or set BAILIAN_WORKSPACE_ID and use the DashScope endpoint.
  • Available combinations are published per model; pass an unknown value to see the list for that model.
  • --api accepts completions or responses; it is ignored when the SDK supports only one style.

bl advisor recommend

Recommend the best models for your use case (intent analysis → candidate recall → LLM ranking). Requires API Key authentication.

Usage

bl advisor recommend --message <text> [flags]
ParameterTypeRequiredDescription
--message <text>stringyesDescribe your requirements
--top <n>numbernoNumber of recommendations (default: 3)
--model <model>stringnoLLM used for every stage: agent, intent, scoring, and explanation (default: qwen-flash-2025-07-28)
--no-agentswitchnoSkip the agent loop and run the deterministic engine directly
--traceswitchnoEmit full routing and performance trace to stderr
--thinkswitchnoShow the engine decision process to stderr
--no-thinkingswitchnoDeprecated no-op: thinking is always disabled for advisor LLM calls

Example: Recommend best models for visual-understanding chatbot requirement

bl advisor recommend --message "I need a visual-understanding chatbot"

Example: Skip Agent clarification and run the recommendation engine directly

bl advisor recommend --message "Build a digital-human livestream" --no-agent
  • Recommendations run intent analysis, routing, candidate recall, scoring, and ranking. Interactive terminals support Agent clarification and multi-step recommendations while preserving the existing recommendation JSON envelope.
  • --trace and --think write only to stderr and do not change the recommendation result on stdout.

bl pipeline run

Run a pipeline workflow definition. No authentication required.

Usage

bl pipeline run --file <path> [flags]
ParameterTypeRequiredDescription
--file <path>stringyesPipeline definition file (YAML/JSON)
--input <json>stringnoRuntime input as inline JSON
--input-file <path>stringnoRuntime input from a JSON file
--concurrency <n>numbernoMax parallel steps (default: 1)
--events <format>stringnoEmit lifecycle events: jsonl
--step-timeout <seconds>numbernoDefault step timeout in seconds

Example: Run pipeline workflow from workflow.yaml with input {'brief':'hello'}

bl pipeline run --file workflow.yaml --input '{"brief":"hello"}'
  • --events jsonl uses text output mode. Pipeline event streams cannot be mixed with other output formats.

bl pipeline validate

Validate a pipeline definition without executing. No authentication required.

Usage

bl pipeline validate --file <path>
ParameterTypeRequiredDescription
--file <path>stringyesPipeline definition file (YAML/JSON)

Example: Validate pipeline definition from file

bl pipeline validate --file workflow.yaml

bl plugin install

Install or upgrade an allowlisted Command Pack. No authentication required.

Usage

bl plugin install --package <name[@version]>
ParameterTypeRequiredDescription
--package <name[@version]>stringyesAllowlisted Command Pack package and optional version or tag

Example: Install allowlisted Command Pack package

bl plugin install --package @ali/bailian-plugin-agent

bl plugin list

List installed Command Packs and their load status. No authentication required.

Usage

bl plugin list

This command only supports global flags.

Example: List installed Command Packs with JSON output

bl plugin list --output json

bl plugin remove

Remove an installed Command Pack. No authentication required.

Usage

bl plugin remove --name <package>
ParameterTypeRequiredDescription
--name <package>stringyesAllowlisted Command Pack package name

Example: Remove installed Command Pack by name

bl plugin remove --name @ali/bailian-plugin-agent

Link an allowlisted local Command Pack for development. No authentication required.

Usage

bl plugin link --path <directory>
ParameterTypeRequiredDescription
--path <directory>stringyesLocal Command Pack package directory

Example: Link local Command Pack for development

bl plugin link --path ../bailian-plugin-agent

bl workspace init

Initialize Bailian workspace and activate postpaid services. No authentication required.

Usage

bl workspace init --access-key-id <id> --access-key-secret <secret> [--security-token <token>]
ParameterTypeRequiredDescription
--access-key-id <id>stringnoAlibaba Cloud Access Key ID
--access-key-secret <secret>stringnoAlibaba Cloud Access Key Secret
--security-token <token>stringnoAlibaba Cloud STS Security Token (optional)

Example: Initialize workspace with access keys

bl workspace init --access-key-id LTAIxxxxx --access-key-secret xxxxx

bl workspace list

List all workspaces.

Usage

bl workspace list [flags]
ParameterTypeRequiredDescription
--list <n>stringnoLimit number of results

Example: List workspaces with limit

bl workspace list --list 5

bl console call

Call a Bailian console API via the CLI gateway.

Usage

bl console call --api <api> --data <json> [flags]
ParameterTypeRequiredDescription
--api <api>stringyesAPI name (e.g. zeldaEasy.broadscope-bailian.memory-library.getLibraries)
--data <json>stringyesRequest data as JSON string

Example: Call Bailian console API with data

bl console call --api zeldaEasy.bailian-commerce.freeTrial.queryFreeTierQuota --data '{"queryFreeTierQuotaRequest":{"models":["qwen3-max"]}}'

bl update

Update the CLI to the latest or a specified version. No authentication required.

Usage

bl update [--to <version>]
ParameterTypeRequiredDescription
--to <version>stringnoInstall this exact version instead of the latest

Example: Update CLI to specific version

bl update --to 0.1.14
  • bl update exits with a non-zero status when an upgrade fails or the latest version cannot be determined, so scripts and agents can detect the failure.

Run bl --help to view all command groups.