# bailian-integration

Part of **BAILIAN**

# Model Studio Developer Tools and Support Console Guide

## Operations Overview

| Operation | Console Navigation | Prerequisites | Description |
|-----------|-------------------|---------------|-------------|
| Integrate MCP Tools | Console > Model Studio > MCP Marketplace | Model Studio API key | Enable built-in model tools and MCP services like web search. |
| Quick Start Token Plan | Console > Token Plan > Management Platform | Administrator access | Subscribe to Token Plan, create members, and generate API keys. |
| Configure Cursor IDE | Cursor Settings > Models | Cursor Pro plan or higher | Connect Cursor to Model Studio using API keys and base URLs. |
| Configure Cline Extension | VS Code > Cline Extension | VS Code installed | Set up Cline with OpenAI-compatible endpoints for code generation. |
| Configure Chatbox | Chatbox Settings > Model Provider | Valid billing plan | Add Model Studio as a custom OpenAI-compatible provider in Chatbox. |
| Configure Cherry Studio | Cherry Studio Settings > Model | Cherry Studio installed | Integrate Cherry Studio desktop client with Model Studio APIs. |
| Configure Dify | Dify Settings > Model Providers | Dify account | Install the TONGYI plugin and configure Qwen models in Dify. |
| Configure Qoder / Lingma | Qoder Settings > Models | Qoder/Lingma IDE installed | Add Model Studio as a provider for coding assistance in Qoder/Lingma. |
| Configure OpenClaw | Terminal / OpenClaw Web UI | Node.js 22+ | Install and configure OpenClaw AI assistant with messaging channels. |
| Connect Third-Party Tools | Console > Model Studio > More Tools | Valid billing plan | Retrieve custom endpoints for Kilo Code, CoPaw, and other IDEs. |
| Create Batch Inference Task | Console > Model Studio > Batch Inference | Pay-as-you-go activated | Upload JSONL files to process large-scale asynchronous inference tasks. |

## Operations Steps

### Integrate MCP Tools

**Navigation**: Console > Model Studio > MCP Marketplace

**Prerequisites**:
- Model Studio API key (format: sk-xxx)
- Access to the MCP Marketplace in Model Studio

1. Navigate to the MCP Marketplace in the left navigation panel.
   - Element: **MCP Marketplace** (link) — left navigation panel

2. Locate and select the desired MCP service from the main content area.
   - Element: **Web Search** (link) — main content area

3. Activate the service by clicking the enable button in the top-right corner.
   - Element: **Enable Now** (button) — top-right corner
   - Notes: A confirmation prompt may appear; confirm the activation.

4. Retrieve the Streamable HTTP Endpoint and API Key from the configuration panel after successful activation.
   - Element: **Configuration Panel** (panel) — main content area

### Quick Start Token Plan

**Navigation**: Console > Token Plan > Management Platform

**Prerequisites**:
- Administrator access to the management platform
- Valid account (primary or RAM user) for subscription

1. Access the purchase page from the top navigation panel.
   - Element: **Token Plan (Team Edition) purchase page** (link) — top navigation panel

2. Choose the appropriate seat type for your team and complete the subscription.
   - Element: **Select a seat type** (dropdown) — main content area

3. Navigate to the management platform to create member accounts.
   - Element: **management platform** (link) — left navigation panel
   - Notes: Usernames must consist of letters, digits, and underscores, and cannot start with a digit.

4. Assign seats to members and generate their dedicated API keys.
   - Element: **Generate API keys** (button) — main content area

### Configure Cursor IDE

**Navigation**: Cursor Settings > Models

**Prerequisites**:
- Node.js 18+ installed
- API Key from Token Plan, Coding Plan, or Pay-as-you-go
- Cursor Pro plan or higher (for custom models)

1. Open the settings menu in the top-right corner of the Cursor IDE.
   - Element: **settings icon** (button) — top-right corner

2. Navigate to the Models configuration section.
   - Element: **Cursor Settings** (menu) — left navigation panel

3. Enable the custom API key and base URL override options.
   - Element: **OpenAI API Key** (checkbox) — main content area

4. Input your credentials and endpoint corresponding to your selected billing plan.
   - Element: **API Key** (text_input) — main content area
   - Notes: Ensure the Base URL matches your region (China or International).

5. Disable the automatic model selection mode in the chat panel.
   - Element: **Auto** (toggle) — chat panel
   - Notes: You must disable Auto mode to manually select a custom model.

6. Choose your desired model from the available list.
   - Element: **model dropdown** (dropdown) — chat panel
   - Notes: Some model names require aliasing (e.g., use kimi-k2-6 for kimi-k2.6).

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| API Key | text_input | Yes | — | The API key for the selected billing plan. |
| Base URL | text_input | Yes | — | The endpoint URL for the selected region and billing plan. |
| Model Name | text_input | Yes | — | The name of the model to use; some require specific aliases. |

### Configure Cline Extension

**Navigation**: VS Code > Cline Extension

**Prerequisites**:
- VS Code installed
- Cline extension installed from Marketplace
- API key from corresponding billing plan

1. Open the Extensions Marketplace and search for the Cline extension.
   - Element: **Cline** (link) — extension marketplace

2. Open the Cline configuration interface from the left sidebar.
   - Element: **Cline** (button) — left sidebar

3. Choose to provide your own credentials.
   - Element: **Bring my own API key** (button) — configuration interface

4. Select the OpenAI-compatible provider type.
   - Element: **OpenAI Compatible** (dropdown) — configuration interface

5. Enter the endpoint and authentication key based on your billing plan.
   - Element: **Base URL** (text_input) — configuration interface
   - Notes: Ensure the Base URL and API Key match the same billing plan and region.

6. Specify the model identifier for inference.
   - Element: **Model ID** (text_input) — configuration interface
   - Notes: Example values include qwen3.7-max or qwen3.6-plus.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| API Provider | dropdown | Yes | OpenAI Compatible | Select the API provider type for integration. |
| Base URL | text_input | Yes | — | Enter the base URL for the selected billing plan and region. |
| API Key | text_input | Yes | — | Enter the dedicated API key for the selected billing plan. |
| Model ID | text_input | Yes | — | Enter the model ID to use for inference. |

### Configure Chatbox

**Navigation**: Chatbox Settings > Model Provider

**Prerequisites**:
- Chatbox application installed or web app access
- Valid billing plan and API key

1. Navigate to the model provider settings in the left navigation panel.
   - Element: **Settings** (menu) — left navigation panel

2. Initiate the addition of a new model provider.
   - Element: **Add** (button) — top-right corner

3. Set the compatibility mode for the provider.
   - Element: **OpenAI API Compatible** (dropdown) — main content area

4. Input your authentication and endpoint details.
   - Element: **API key** (text_input) — form fields

5. Finalize the provider creation.
   - Element: **Create** (button) — prompt edit drawer

6. Specify the model identifier in the newly created provider configuration.
   - Element: **model ID** (text_input) — prompt edit drawer

### Configure Cherry Studio

**Navigation**: Cherry Studio Settings > Model

**Prerequisites**:
- Cherry Studio installed
- Valid account with Model Studio access

1. Open the settings menu in the upper-right corner.
   - Element: **settings button** (button) — upper-right corner

2. Add a new model configuration in the Model section.
   - Element: **Add** (button) — Model section

3. Provide a descriptive name for the connection.
   - Element: **provider name** (text_input) — form field

4. Select the OpenAI provider type.
   - Element: **OpenAI** (dropdown) — provider type dropdown

5. Enter your region-specific API key and endpoint address.
   - Element: **API key** (text_input) — form field
   - Notes: Use China (Beijing) or Singapore endpoints based on your region.

6. Specify the model identifier.
   - Element: **Model ID** (text_input) — form field

7. Save the configuration.
   - Element: **Add** (button) — bottom of form

### Configure Dify

**Navigation**: Dify Settings > Model Providers

**Prerequisites**:
- Dify account with workspace access
- Model Studio API key

1. Access the Dify Marketplace to install the required plugin.
   - Element: **Dify Marketplace** (link) — top navigation panel

2. Install the official TONGYI plugin.
   - Element: **TONGYI** (button) — Plugins section

3. Open the workspace settings from the top-right corner.
   - Element: **profile picture** (button) — top-right corner

4. Navigate to the model providers configuration.
   - Element: **Model Providers** (menu) — left navigation panel

5. Open the configuration dialog for the TONGYI provider.
   - Element: **Configure** (button) — TONGYI card

6. Configure the endpoint routing based on your API key region.
   - Element: **Use International Endpoint** (checkbox) — API-KEY Settings section
   - Notes: Set to Yes for Singapore region, No for Beijing region.

7. Enable the specific models you wish to use.
   - Element: **model list** (dropdown) — TONGYI card

8. Create a new application to test the integration.
   - Element: **Create blank app** (button) — workspace

### Configure Qoder / Lingma IDE

**Navigation**: Qoder Settings > Models

**Prerequisites**:
- Qoder or Lingma IDE installed
- API Key for Token Plan or Coding Plan

1. Open the settings menu from the top-right corner of the IDE.
   - Element: **Settings** (menu) — top-right corner

2. Navigate to the Models section and initiate a new configuration.
   - Element: **Add** (button) — Models section

3. Select the region-specific Model Studio provider.
   - Element: **Alibaba Cloud Model Studio - China** (dropdown) — Configuration form

4. Choose your subscribed billing plan type.
   - Element: **Token Plan** (dropdown) — Configuration form

5. Select a supported text generation model.
   - Element: **Model** (dropdown) — Configuration form

6. Paste your dedicated API key.
   - Element: **API Key** (text_input) — Configuration form
   - Notes: Copy the key exactly without leading or trailing spaces.

7. Save and validate the configuration.
   - Element: **Add** (button) — bottom of form

### Configure OpenClaw

**Navigation**: Terminal / OpenClaw Web UI

**Prerequisites**:
- Node.js 22 or later installed
- API key for selected access method

1. Execute the installation script in your terminal.
   - Element: **curl -fsSL https://openclaw.ai/install.sh | bash** (text_input) — terminal

2. Launch the onboarding wizard.
   - Element: **openclaw onboard** (button) — terminal

3. Select the quick setup mode.
   - Element: **QuickStart** (radio) — onboarding wizard

4. Bypass initial model and channel setup to configure manually later.
   - Element: **Skip for now** (button) — onboarding wizard

5. Access the advanced configuration interface via the Web UI.
   - Element: **Configuration > Settings > Advanced > Open** (link) — left menu

6. Input your JSON configuration containing the API key and Base URL.
   - Element: **Copy and paste JSON configuration** (text_input) — configuration editor

7. Apply the configuration changes.
   - Element: **Save** (button) — configuration page

8. Restart the gateway service to load the new settings.
   - Element: **openclaw gateway restart** (button) — terminal

### Connect Third-Party Tools (Kilo Code / CoPaw)

**Navigation**: Console > Model Studio > More Tools / Coding Plan

**Prerequisites**:
- Valid subscription plan
- Third-party tool compatible with OpenAI or Anthropic API protocols

1. Navigate to the tools integration section in the console.
   - Element: **More Tools** (link) — left navigation panel

2. Select your active billing plan to view credentials.
   - Element: **Token Plan (Team Edition)** (button) — main content area

3. Copy the region-specific endpoint URL.
   - Element: **Base URL** (text_input) — table cell

4. Copy the authentication key.
   - Element: **API Key** (text_input) — table cell

5. In your third-party tool (e.g., Kilo Code), choose to provide custom credentials.
   - Element: **Bring my own Key** (button) — Main content area

6. Set the provider compatibility mode.
   - Element: **API Provider** (dropdown) — Settings form

7. Paste the endpoint and API key into the tool's settings.
   - Element: **Base URL** (text_input) — Settings form

8. Add your desired model and apply the configuration.
   - Element: **Use custom** (button) — Model selection section

### Create Batch Inference Task

**Navigation**: Console > Model Studio > Batch Inference

**Prerequisites**:
- Model Studio activated
- Pay-as-you-go billing mode enabled

1. Initiate a new batch processing job from the top of the page.
   - Element: **Create Batch Inference Task** (button) — top of page

2. Provide a unique identifier and optional description for the job.
   - Element: **Task Name** (text_input) — dialog
   - Notes: You can download a JSONL template file from this dialog.

3. Set the maximum duration the task will wait in the queue before expiring.
   - Element: **Maximum Wait Time** (dropdown) — dialog
   - Notes: Options range from 1 day to 14 days.

4. Submit the task for processing.
   - Element: **Confirm** (button) — bottom of dialog

5. Monitor the task execution progress in the list view.
   - Element: **Progress** (section) — task list page

6. Check the final execution state of the task.
   - Element: **Status** (section) — task list page
   - Notes: For failed tasks, hover over the status to view an error summary and download the error file.

7. Download the output file containing successful inference results.
   - Element: **View Results** (button) — task action column

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Task Name | text_input | Yes | — | A unique identifier name for the batch task. |
| Description | text_input | No | — | A brief explanation of the task purpose. |
| Maximum Wait Time | dropdown | Yes | 1 day, 2 days, 3 days, 7 days, 14 days | The maximum queue wait time before automatic expiration. |

## FAQ

Q: Why am I getting a 401 Unauthorized error in my IDE extension?
A: This usually occurs if the API key and Base URL do not belong to the same billing plan or region. Ensure your API key matches the specific endpoint (e.g., Token Plan vs. Coding Plan) and region (China vs. International). API keys are strictly isolated by billing plan.

Q: Can I use the same API key for both Cursor and Cline?
A: Yes, as long as both IDEs are configured with the exact same Base URL and billing plan credentials. However, you cannot use a Coding Plan API key with a Pay-as-you-go Base URL.

Q: Where do I find the API key for the Token Plan (Team Edition)?
A: Navigate to the Token Plan Management Platform in the console, create member accounts, assign seats, and click the Generate API keys button. Each member receives a dedicated key.

Q: What happens if my batch inference task fails?
A: You can hover over the status indicator in the task list to view an error summary. Click the download option to get the error file, which contains detailed information about the failed requests, including the specific custom_id and error codes.

Q: Do custom models in Cursor require a paid subscription?
A: Yes. The free version of Cursor only supports Auto mode. To manually select and configure custom models via the OpenAI API Key override, you must have a Cursor Pro plan or higher.

## Pricing & Billing

### Billing Models
Model Studio offers multiple billing models depending on the integration and usage pattern:
- **Token Plan (Team Edition)**: Prepaid subscription where usage deducts from a shared Credits balance.
- **Coding Plan**: Fixed monthly subscription or per-request billing optimized for IDE integrations and code generation.
- **Pay-as-you-go**: Post-paid billing based on actual token consumption or request counts.
- **Batch Inference**: Asynchronous processing billed at 50% the cost of real-time inference.

### Price Reference

| Tier / Model | Input Price | Output Price | Notes |
|--------------|-------------|--------------|-------|
| Token Plan (Team Edition) | Deducts Credits per token | Deducts Credits per token | Built-in tools consume tokens from the credit balance. |
| Coding Plan (qwen3.6-plus) | 0.002 CNY / 1,000 tokens | 0.004 CNY / 1,000 tokens | Billed by number of model calls or tokens. |
| Pay-as-you-go | Post-paid based on usage | Post-paid based on usage | Rates vary by specific model selected. |
| Batch Inference (qwen-max) | 0.002 CNY / 1,000 tokens | 0.004 CNY / 1,000 tokens | 50% discount compared to real-time inference. |
| MCP Services (e.g., Web Search) | Free for a limited time | Free for a limited time | Subject to monthly free quotas. |

### Free Tier
- **MCP Services**: Monthly free quota available for select built-in tools and MCP services.
- **Coding Plan**: Some models include a free tier of 1 million tokens per month for testing and initial setup.
- **Qoder / Lingma**: Limited-time free trial available for Individual Pro Edition.

### Billing Notes
- API keys are not interchangeable across billing plans. Using a plan API key outside its permitted scope may result in suspension or key revocation.
- Batch inference tasks are only billed upon successful completion; running or queued tasks do not incur charges.
- Free quota updates hourly; actual usage may temporarily exceed console balance displays due to synchronization delays.
- Text-to-video and asynchronous generation tasks are billed upon completion, with minimum charge thresholds applying.

## Source Documents

- Integrate tools_6528494.xdita
- Quick start_6523065.xdita
- Cursor_6398422.xdita
- Cursor_6413446.xdita
- Cline_5603921.xdita
- Cline_6413445.xdita
- Chatbox_5603919.xdita
- Cherry Studio_5603920.xdita
- Dify_5603922.xdita
- Lingma_6539230.xdita
- Qoder_6539146.xdita
- Lingma_6464141.xdita
- Qoder_6451007.xdita
- OpenClaw formerly ClawdbotMoltbot_6398314.xdita
- OpenClaw_6398314.xdita
- OpenClaw_6413448.xdita
- More tools_6551983.xdita
- Kilo Code_6413452.xdita
- Other tools_6413455.xdita
- Set up AI tools_6413424.xdita
- Batch inference_5446550.xdita