A one-stop large language model platform offering Text Generation, Deep Thinking, and Visual Understanding. Fully compatible with the OpenAI SDK — just change the base URL and API key. One API key unlocks AppBuilder, ModelBuilder, and AI Open Capabilities simultaneously.
ernie-4.5
deepseek-v4
GLM
Qwen
Kimi
System Prompt
Temperature
0.7
Max Tokens
2048
Capability
TextVisionFunc Call
Quick Start Guide
Four steps from zero to your first API call — no migration needed if you already use OpenAI SDK
01
Register & Get API Key
Sign up for a Baidu AI Cloud International account, then navigate to IAM → API Key Management to create a new key. Your key starts with bce-v3/ and must be prefixed with Bearer in requests. One key supports all three capabilities: AppBuilder, ModelBuilder, and AI Open Capabilities.
Qianfan is fully compatible with the OpenAI SDK. If you already use it, skip this step. Otherwise install with pip. No proprietary SDK needed — just the standard OpenAI Python package.
pip install openai
03
Configure & Call
Set base_url to api.baiduqianfan.ai/v1 and pass your API key. The appid header is optional. Choose any model from the pricing table below — ernie-4.5, deepseek-v4-pro, GLM, Qwen, and more.
04
Explore Capabilities
Beyond basic chat, try Structured Output for JSON responses, Function Calling for agent workflows, and Visual Understanding for image-based tasks. All through the same API endpoint — just change the model and parameters.
Three core model capabilities plus advanced technical features
F01
Text Generation
Supports writing, dialogue, summarization, and Q&A. Use system and user roles in the messages array to control behavior. Example models: ernie-4.5, ernie-3.5-8k, ernie-4.0-turbo-8k.
F02
Deep Thinking
Advanced reasoning mode for complex problem solving — decision support, multi-step reasoning, and analytical tasks that require deeper cognitive processing.
F03
Visual Understanding
Object recognition, scene understanding, and image description. Process images alongside text for multimodal tasks including document analysis and visual Q&A.
F04
Structured Output
Enforce JSON schema responses for reliable, parseable output. Ideal for building data pipelines, API integrations, and automated workflows that require consistent formatting.
F05
Function Calling
Define tools and functions that the model can call autonomously. Build agents that interact with external APIs, databases, and services — with full parameter extraction and validation.
F06
Dialogue Prefix Continuation
Provide a partial assistant response and let the model continue from there. Useful for controlled generation, prompt chaining, and building conversational flows with predefined starting points.
Model Pricing & Discounts
Official Model Service Quotation (EN0923) — Qianfan International price list in USD, up to 55% off. Valid Sep 11 – Oct 11, 2026.
Qianfan International Site — Official Price List
USD per the official international price list · prices per million tokens (Input / Cache-hit / Output)
No.
Model
Version
List Price (USD)
Product Codes
Discount
1
GLM
5.3
Input $1.40
Cache-hit $0.26
Output $4.40
In S1733826500500851407
Ck S1733826500500851409
Out S1733826500500851408
40% OFF
2
GLM
5.2
Input $1.40
Cache-hit $0.26
Output $4.40
In S1733826500500851318
Ck S1733826500500851316
Out S1733826500500851317
55% OFF
3
GLM
5.2-Fast
Input $2.25
Cache-hit $0.56
Output $7.88
In S172382650050085010
Ck S172382650050085007
Out S172382650050085009
40% OFF
4
DeepSeek
V4.1-Flash
Input $0.30
Cache-hit $0.006
Output $1.20
In S172382650050085033
Ck S172382650050085035
Out S172382650050085036
40% OFF
5
DeepSeek
V4-Pro-0813
Input $1.32
Cache-hit $0.042
Output $3.96
In S1733826500500851399
Ck S1733826500500851401
Out S1733826500500851400
35% OFF
6
DeepSeek
V4-Flash-0731
Input $0.44
Cache-hit $0.014
Output $1.32
In S1733826500500851386
Ck S1733826500500851384
Out S1733826500500851385
45% OFF
7
Qianfan-VL
V1
Input $3.00
Cache-hit $0.30
Output $15.00
In S1733826500500851413
Ck S1733826500500851415
Out S1733826500500851414
25% OFF
This quotation is valid for one month (Sep 11 – Oct 11, 2026). Please contact Baidu AI Cloud Intl Business Dept for reconfirmation upon expiry.
All discounts are calculated based on each model's official standard list price. The final transaction price shall be subject to the commercial contract signed by both parties.
List price format: Input / Cache-hit / Output per million tokens, in USD per the official Qianfan international price list. For VOD Overseas Site pricing (Gemini, Claude, GPT, Kimi and more), see the VOD platform page.
More models (ERNIE, Qwen, Kimi and more) are available in the Qianfan Intl console — see the Model List & Pricing links in the Quick Start section above.
Code Examples — Copy & Run
Fully compatible with OpenAI SDK. Just swap the base_url and api_key — your existing code works as-is.
Python — OpenAI SDK
from openai import OpenAI
client = OpenAI(
api_key="bce-v3/ALTAK-xxxxxxxx/xxxxxxxxxxxxxxxx", # Your Qianfan API Key
base_url="https://api.baiduqianfan.ai/v1", # Qianfan endpoint
default_headers={"appid": "app-xxxxxx"} # Optional: your appid
)
completion = client.chat.completions.create(
model="ernie-4.0-turbo-8k", # Or: ernie-4.5, deepseek-v4-pro, GLM, Qwen...
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello!"}
]
)
print(completion.choices[0].message)
Full API reference, model list, parameter descriptions, and integration guides. Follow this doc for the most up-to-date configuration methods and usage details.