---
title: Baidu: ERNIE 4.5 21B A3B Thinking | Text Generation | ModelsLab
description: Efficient 21B MoE reasoning model with 3B active parameters, 131K context, tool integration, and expert performance on math, coding, and logic tasks.
url: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/baidu/baidu-ernie-4.5-21b-a3b-thinking/api.md
canonical: https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/baidu/baidu-ernie-4.5-21b-a3b-thinking/api.md
type: product
component: Playground/LLM/Index
generated_at: 2026-05-13T10:36:43.422867Z
---

Baidu: ERNIE 4.5 21B A3B Thinking
---

 [LLMs.txt](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/baidu-ernie-4.5-21b-a3b-thinking/llms.txt) [.md](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/baidu/baidu-ernie-4.5-21b-a3b-thinking.md)

baidu-ernie-4.5-21b-a3b-thinking baidu Closed Source Model $0.175000 / call

Baidu: ERNIE 4.5 21B A3B Thinking
---

Choose a prompt below to get started or type your own message

 Explain quantum computing in simple terms

 Write a Python function to sort a list

 Create a marketing email for a SaaS product

 Compare REST vs GraphQL APIs

Send

### Baidu: ERNIE 4.5 21B A3B Thinking

baidu baidu-ernie-4.5-21b-a3b-thinking

Copy model ID

PricingInput $0.07 / 1M tokens

Output $0.28 / 1M tokens

API EndpointsOpenAI Compatible

`https://modelslab.com/api/v7/llm/chat/completions`Endpoint

Anthropic Compatible

`https://modelslab.com/api/v7/llm/v1/messages`Messages

`https://modelslab.com/api/v7/llm/v1/messages/count_tokens`Count Tokens

`https://modelslab.com/api/v7/llm/v1/models`Models

Use with Claude Code

cURL Example

ParametersSystem MessageYou are a helpful AI assistant specialized in providing accurate and detailed responses.

Temperature0.7

Max Tokens1000

Top P0.9

Frequency Penalty0

Presence Penalty0

Model Info

Support

Related Models
---

Discover similar models you might be interested in

 [View all LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster)

[M(](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.3)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai)

 [Mistral (7B) Instruct v0.3

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.3)

[M1](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/gryphe-mythomax-l2-13b)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [MythoMax 13B

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/gryphe-mythomax-l2-13b)

[QN](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen3-Next-80B-A3B-Instruct)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [Qwen3 Next 80B A3b Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen3-Next-80B-A3B-Instruct)

[QQ](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-30b-a3b-thinking-2507)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Qwen: Qwen3 30B A3B Thinking 2507

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-30b-a3b-thinking-2507)

[QN](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen3-Next-80B-A3B-Thinking)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [Qwen3 Next 80B A3b Thinking

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/Qwen-Qwen3-Next-80B-A3B-Thinking)

[GO](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/zai-org-GLM-OCR)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [GLM OCR

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/zai-org-GLM-OCR)

[QQ](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-coder-next)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Qwen: Qwen3 Coder Next

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-coder-next)

[MM](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-01)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [MiniMax: MiniMax-01

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/minimax-minimax-01)

[ER](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/essentialai-rnj-1-instruct)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [EssentialAI: Rnj 1 Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/essentialai-rnj-1-instruct)

[MM](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/morph-morph-v3-large)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Morph: Morph V3 Large

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/morph-morph-v3-large)

[QQ](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-next-80b-a3b-instruct)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Qwen: Qwen3 Next 80B A3B Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-next-80b-a3b-instruct)

[QQ](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-vl-8b-instruct)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Qwen: Qwen3 VL 8B Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/qwen-qwen3-vl-8b-instruct)

[XG](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/x-ai-grok-code-fast-1)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [xAI: Grok Code Fast 1

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/x-ai-grok-code-fast-1)

[GG](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-3.1-flash-lite)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Google: Gemini 3.1 Flash Lite

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/google-gemini-3.1-flash-lite)

[ML](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/meta-llama-Llama-3.3-70B-Instruct)[Together AI](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai)

 [meta-llama/Llama-3.3-70B-Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/together_ai/meta-llama-Llama-3.3-70B-Instruct)

[ML](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-mistral-large-2407)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Mistral Large 2407

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/mistralai-mistral-large-2407)

[M(](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.1)[ModelsLab](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai)

 [Mistral (7B) Instruct

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/mistral_ai/mistralai-Mistral-7B-Instruct-v0.1)

[AN](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/amazon-nova-premier-v1)[Open Router](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router)

 [Amazon: Nova Premier 1.0

Closed Source Model](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router/amazon-nova-premier-v1)

About Baidu: ERNIE 4.5 21B A3B Thinking
---

ERNIE-4.5-21B-A3B-Thinking is Baidu's upgraded lightweight MoE model, refined to boost reasoning depth and quality for top-tier performance in logical puzzles, math, science, coding, text generation, and expert-level academic benchmarks.

### Technical Specifications

Model IDbaidu-ernie-4.5-21b-a3b-thinkingCategoryLLM ModelsTaskText GenerationPrice$0.175000 per million tokensAddedFebruary 20, 2026

### Key Features

- Chat completion and multi-turn conversation API
- Streaming response with token-by-token output
- Function calling and tool use support
- System prompts and role-based messaging
- JSON mode and structured output

### Quick Start

Integrate Baidu: ERNIE 4.5 21B A3B Thinking into your application with a single API call. Get your API key from the [pricing page](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing) to get started.

PythonJavaScriptcURLPHP

```
<code>import requests
import json

url = "https://modelslab.com/api/v7/llm/chat/completions"

headers = {
    "Content-Type": "application/json"
}

data = {
        "model_id": "baidu-ernie-4.5-21b-a3b-thinking",
        "messages": [
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
        "max_tokens": 1000,
        "key": "YOUR_API_KEY"
    }

try:
    response = requests.post(url, headers=headers, json=data)
    response.raise_for_status()  # Raises an HTTPError for bad responses (4XX or 5XX)
    result = response.json()
    print("API Response:")
    print(json.dumps(result, indent=2))
except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err} - {response.text}")
except Exception as err:
    print(f"Other error occurred: {err}")</code>
```

View the [full API documentation](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/baidu/baidu-ernie-4.5-21b-a3b-thinking/api) for SDKs, code examples in Python, JavaScript, and more.

### Pricing

Baidu: ERNIE 4.5 21B A3B Thinking API costs $0.175000 per million tokens. Pay only for what you use with no minimum commitments. [View pricing plans](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

### Use Cases

- AI chatbots and virtual assistants
- Code generation and developer tools
- Content writing and copywriting automation
- Data analysis, summarization, and extraction

[Browse LLM Models](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models?feature=llmaster) [More from Baidu](https://modelslab-frontend-v2-927501783998.us-east4.run.app/models/open_router) [View Pricing](https://modelslab-frontend-v2-927501783998.us-east4.run.app/pricing)

Baidu: ERNIE 4.5 21B A3B Thinking FAQ
---

### What is Baidu: ERNIE 4.5 21B A3B Thinking?

ERNIE-4.5-21B-A3B-Thinking is Baidu's upgraded lightweight MoE model, refined to boost reasoning depth and quality for top-tier performance in logical puzzles, math, science, coding, text generation, and expert-level academic benchmarks.

### How do I use the Baidu: ERNIE 4.5 21B A3B Thinking API?

You can integrate Baidu: ERNIE 4.5 21B A3B Thinking into your application with a single API call. Sign up on ModelsLab to get your API key, then use the model ID "baidu-ernie-4.5-21b-a3b-thinking" in your API requests. We provide SDKs for Python, JavaScript, and cURL examples in the API documentation.

### How much does Baidu: ERNIE 4.5 21B A3B Thinking cost?

Baidu: ERNIE 4.5 21B A3B Thinking costs $0.175000 per million tokens. ModelsLab uses pay-per-use pricing with no minimum commitments. A free tier is available to get started.

### What is the Baidu: ERNIE 4.5 21B A3B Thinking model ID?

The model ID for Baidu: ERNIE 4.5 21B A3B Thinking is "baidu-ernie-4.5-21b-a3b-thinking". Use this ID in your API requests to specify this model.

### Does Baidu: ERNIE 4.5 21B A3B Thinking have a free tier?

Yes, ModelsLab offers a free tier that lets you try Baidu: ERNIE 4.5 21B A3B Thinking and other AI models. Sign up to get free API credits and start building immediately.

---

*This markdown version is optimized for AI agents and LLMs.*

**Links:**
- [Website](https://modelslab.com)
- [API Documentation](https://docs.modelslab.com)
- [Blog](https://modelslab.com/blog)

---
*Generated by ModelsLab - 2026-05-13*