> ## Documentation Index
> Fetch the complete documentation index at: https://aisa.one/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> - Base URLs: models `https://api.aisa.one/v1` (Gemini GenerateContent: `https://api.aisa.one/v1beta`); data APIs `https://api.aisa.one/apis/v1`. The `servers` of each operation in https://aisa.one/openapi.yaml is authoritative.
> - Auth: `Authorization: Bearer $AISA_API_KEY`. Never print, log, or commit the key.
> - MCP (preferred for agents): `https://mcp.aisa.one/mcp`, signed in with OAuth, so there is no key to paste.
> - Agent Skill: `npx skills add AIsa-team/agent-skills --skill aisa`. Fallback with the AIsa CLI: `aisa skills install aisa`.
> - Spending: docs, https://aisa.one/models, https://aisa.one/api, `/v1/models`, and MCP `search`, `list_categories`, `get_details`, `batch_quote`, and the `account` operation are free. Quote the exact calls before running them (MCP `batch_quote`, CLI `aisa quote --json`). If the quote reports `auto_execute_eligible: true`, run it unless the user set a tighter limit or asked only for a quote. Otherwise, tell the user in one message the planned calls, the quoted price, and a total USD budget for the task, then wait for approval. Direct HTTP calls follow the stricter rule at https://aisa.one/docs/get-started/cli.md#direct-http-fallback. Do not make paid calls to test availability. Full rule: https://aisa.one/llms.txt

# AIsa CN-LLM Route

> Route Chinese-language prompts to Chinese LLM families through AIsa.

[View on GitHub →](https://github.com/AIsa-team/agent-skills/tree/main/ai-models/cn-llm)

**Chinese LLM routing through AIsa.** Send Chinese-language tasks to Qwen, DeepSeek, GLM, Baichuan, and related model families.

## Install

```bash npx skills theme={null}
npx skills add AIsa-team/agent-skills --skill cn-llm
```

```bash AIsa CLI theme={null}
npm install -g @aisa-one/cli
aisa skills install cn-llm
```

Start a new agent session after installing so the skill loads.

## What can agents do with it?

> [card] Chinese prompts
>
> Route Chinese-language tasks to strong Chinese LLMs.

> [card] Model selection
>
> Choose between Qwen, DeepSeek, GLM, Baichuan, and related models.

> [card] Bilingual workflows
>
> Switch between Chinese and global model families.

> [card] Agent defaults
>
> Give agents practical routing heuristics.

## 🔥 What You Can Do

### Intelligent Chat

```
"Use Qwen to answer Chinese questions, use DeepSeek for coding"
```

### Deep Reasoning

```
"Use DeepSeek V4 Pro for complex reasoning tasks"
```

### Code Generation

```
"Use DeepSeek-Coder to generate Python code with explanations"
```

### Long Text Processing

```
"Use Qwen-Long for ultra-long document summarization"
```

### Model Comparison

```
"Compare response quality between Qwen3.7 Max and DeepSeek V4.1 Flash"
```

## Supported Models

### Qwen (Alibaba)

| Model | Features |
| - | - |
| qwen3.7-max | Most powerful general model |
| qwen3-coder-flash | Fast code generation |
| qwen3-vl-plus | Vision-language model |
| qwen-plus-2025-12-01 | Plus version |
| qwen-mt-flash | Fast machine translation |
| qwen-mt-lite | Lite machine translation |

### DeepSeek

| Model | Features |
| - | - |
| deepseek-v4-pro | Stronger reasoning and coding |
| deepseek-v4.1-flash | Low-cost general chat, supports Tools |

> **Note**: Model availability may change. See [aisa.one/models](https://aisa.one/models) for the latest list and current prices.

## Quick Start

```bash theme={null}
export AISA_API_KEY="your-key"
```

## API Endpoints

### OpenAI Compatible Interface

```
POST https://api.aisa.one/v1/chat/completions
```

#### Qwen Example

```bash theme={null}
curl -X POST "https://api.aisa.one/v1/chat/completions" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.7-max",
    "messages": [
      {"role": "system", "content": "You are a professional Chinese assistant."},
      {"role": "user", "content": "Please explain what a large language model is?"}
    ],
    "temperature": 0.7,
    "max_tokens": 1000
  }'
```

#### DeepSeek Example

```bash theme={null}
# DeepSeek V4.1 Flash low-cost chat
curl -X POST "https://api.aisa.one/v1/chat/completions" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Write a quicksort algorithm in Python"}],
    "temperature": 0.3
  }'

# DeepSeek V4 Pro stronger reasoning
curl -X POST "https://api.aisa.one/v1/chat/completions" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4-pro",
    "messages": [{"role": "user", "content": "A farmer needs to cross a river with a wolf, a sheep, and a cabbage. The boat can only carry the farmer and one item at a time. If the farmer is not present, the wolf will eat the sheep, and the sheep will eat the cabbage. How can the farmer safely cross?"}]
  }'
```

#### Qwen3 Code Generation Example

```bash theme={null}
curl -X POST "https://api.aisa.one/v1/chat/completions" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-coder-flash",
    "messages": [{"role": "user", "content": "Implement a thread-safe Map in Go"}]
  }'
```

#### Parameter Reference

| Parameter | Type | Required | Description |
| - | - | - | - |
| `model` | string | Yes | Model identifier |
| `messages` | array | Yes | Message list |
| `temperature` | number | No | Randomness (0-2, default 1) |
| `max_tokens` | integer | No | Maximum tokens to generate |
| `stream` | boolean | No | Stream output (default false) |
| `top_p` | number | No | Nucleus sampling parameter (0-1) |

#### Response Format

```json theme={null}
{
  "id": "chatcmpl-xxx",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "qwen3.7-max",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A large language model (LLM) is a deep learning-based..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 30,
    "completion_tokens": 150,
    "total_tokens": 180
  }
}
```

### Streaming Output

```bash theme={null}
curl -X POST "https://api.aisa.one/v1/chat/completions" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-plus-2025-12-01",
    "messages": [{"role": "user", "content": "Tell a Chinese folk story"}],
    "stream": true
  }'
```

Returns Server-Sent Events (SSE) format:

```
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":"Once"}}]}
data: {"id":"chatcmpl-xxx","choices":[{"delta":{"content":" upon"}}]}
...
data: [DONE]
```

## Python Client

### CLI Usage

```bash theme={null}
# Qwen chat
python3 scripts/cn_llm_client.py chat --model qwen3.7-max --message "Hello, please introduce yourself"

# Qwen3 code generation
python3 scripts/cn_llm_client.py chat --model qwen3-coder-flash --message "Write a binary search algorithm"

# DeepSeek V4 Pro reasoning
python3 scripts/cn_llm_client.py chat --model deepseek-v4-pro --message "Which is larger, 9.9 or 9.11? Please reason in detail"

# DeepSeek V4.1 Flash chat
python3 scripts/cn_llm_client.py chat --model deepseek-v4.1-flash --message "Tell a story" --stream

# With system prompt
python3 scripts/cn_llm_client.py chat --model qwen3.7-max --system "You are a classical poetry expert" --message "Write a poem about plum blossoms"

# Model comparison
python3 scripts/cn_llm_client.py compare --models "qwen3.7-max,deepseek-v4.1-flash" --message "What is quantum computing?"

# List supported models
python3 scripts/cn_llm_client.py models
```

### Python SDK Usage

```python theme={null}
from cn_llm_client import CNLLMClient

client = CNLLMClient()  # Uses AISA_API_KEY environment variable

# Qwen chat
response = client.chat(
    model="qwen3.7-max",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response["choices"][0]["message"]["content"])

# Qwen3 code generation
response = client.chat(
    model="qwen3-coder-flash",
    messages=[
        {"role": "system", "content": "You are a professional programmer."},
        {"role": "user", "content": "Implement a singleton pattern in Python"}
    ],
    temperature=0.3
)

# Streaming output
for chunk in client.chat_stream(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Tell a story about an idiom"}]
):
    print(chunk, end="", flush=True)

# Model comparison
results = client.compare_models(
    models=["qwen3.7-max", "deepseek-v4.1-flash", "deepseek-v4-pro"],
    message="Explain what machine learning is"
)
for model, result in results.items():
    print(f"{model}: {result['response'][:100]}...")
```

## Use Cases

### 1. Chinese Content Generation

```python theme={null}
# Copywriting
response = client.chat(
    model="qwen3.7-max",
    messages=[
        {"role": "system", "content": "You are a professional copywriter."},
        {"role": "user", "content": "Write a product introduction for a smart watch"}
    ]
)
```

### 2. Code Development

```python theme={null}
# Code generation and explanation
response = client.chat(
    model="qwen3-coder-flash",
    messages=[{"role": "user", "content": "Implement a thread-safe Map in Go"}]
)
```

### 3. Complex Reasoning

```python theme={null}
# Mathematical reasoning
response = client.chat(
    model="deepseek-v4-pro",
    messages=[{"role": "user", "content": "Prove: For any positive integer n, n³-n is divisible by 6"}]
)
```

### 4. Visual Understanding

```python theme={null}
# Image understanding
response = client.chat(
    model="qwen3-vl-plus",
    messages=[
        {"role": "user", "content": [
            {"type": "text", "text": "Describe the content of this image"},
            {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
        ]}
    ]
)
```

### 5. Model Routing Strategy

```python theme={null}
MODEL_MAP = {
    "chat": "qwen3.7-max",           # General chat
    "code": "qwen3-coder-flash",   # Code generation
    "reasoning": "deepseek-v4-pro",    # Complex reasoning
    "vision": "qwen3-vl-plus",     # Visual understanding
    "fast": "qwen3.7-flash",       # Fast response
    "translate": "qwen-mt-flash"   # Machine translation
}

def route_by_task(task_type: str, message: str) -> str:
    model = MODEL_MAP.get(task_type, "qwen3.7-max")
    return client.chat(model=model, messages=[{"role": "user", "content": message}])
```

## Error Handling

Errors return JSON with `error` field:

```json theme={null}
{
  "error": {
    "code": "model_not_found",
    "message": "Model 'xxx' is not available"
  }
}
```

Common error codes:

* `401` - Invalid or missing API Key
* `402` - Insufficient balance
* `404` - Model not found
* `429` - Rate limit exceeded
* `500` - Server error

## Pricing

Token-based pricing varies by model. See [aisa.one/models](https://aisa.one/models) for current rates. Each response includes `usage.cost` and `usage.credits_remaining`.

## Full API Reference

See [API Reference](https://aisa.one/docs/api-reference.md) for complete endpoint documentation.

## Get started

1. Sign up at [aisa.one](https://aisa.one) and create an API key in the console.
2. Set it in your shell: `export AISA_API_KEY="your-key"`.
3. Install the skill with one of the commands under [Install](#install), then start a new agent session.

## Related

> [card] [Model Catalog](https://aisa.one/docs/guides/models.md)
>
> Every model family on AIsa, with model IDs and endpoints.

> [card] [AIsa LLM Router](https://aisa.one/docs/agent-skills/llm-router.md)
>
> General-purpose model routing across providers.

> [card] [Model Catalog](https://aisa.one/docs/guides/models.md)
>
> Browse supported model IDs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.