Back to Home
Product 01 — LLM Platform

QIANFAN LLM Workshop

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
Text Vision Func 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.
Register Now →
Open Console →
02
Install the SDK
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.

Platform Capabilities

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

Current promotional discounts across all supported models — up to 60% off with additional volume-based savings

Model Discount Max Discount (+10%) Savings Range
ernie-4.5 40% OFF 50% OFF 40% – 50%
ernie-x1.1 10% OFF 20% OFF 10% – 20%
ernie-5.1 30% OFF 40% OFF 30% – 40%
deepseek-v3.2 40% OFF 50% OFF 40% – 50%
deepseek-v4-pro 60% OFF 70% OFF 60% – 70%
GLM 45% OFF 55% OFF 45% – 55%
Qwen 50% OFF 60% OFF 50% – 60%
Kimi 40% OFF 50% OFF 40% – 50%
GPT 25% OFF 35% OFF 25% – 35%
Note: Base discounts apply to all users. The additional +10% discount range is available for volume-based commitments and enterprise agreements. Discounts are promotional and subject to change. Contact sales for custom pricing.

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)

cURL — Raw HTTP Request
curl --location 'https://api.baiduqianfan.ai/v1/chat/completions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer bce-v3/ALTAK-xxxxxxxx/xxxxxxxxxxxxxxxx' \ --data '{ "model": "ernie-3.5-8k", "messages": [ {"role": "system", "content": "Platform Assistant"}, {"role": "user", "content": "Hello"} ] }'
Official Documentation
Full API reference, model list, parameter descriptions, and integration guides. Follow this doc for the most up-to-date configuration methods and usage details.
https://intl.cloud.baidu.com/en/doc/qianfan/s/qm8qxemze-intl-en
View Docs

Technical Specifications

API Endpointhttps://api.baiduqianfan.ai/v1/chat/completions
SDK Base URLhttps://api.baiduqianfan.ai/v1
Auth MethodBearer Token — key prefixed with "Bearer bce-v3/..."
API Key Consolehttps://console.bce.baidu.com/iam/#/iam/apikey/list
SDK CompatibilityOpenAI SDK (Python) — drop-in replacement
Request FormatJSON: model (string) + messages (array of {role, content})
Optional Headerappid — your Qianfan appid (passed via default_headers in SDK)
Core CapabilitiesText Generation, Deep Thinking, Visual Understanding
Advanced FeaturesStructured Output, Function Calling, Dialogue Prefix Continuation, Usage Statistics
Multi-IntegrationOne API key supports AppBuilder + ModelBuilder + AI Open Capabilities
Example Modelsernie-4.5, ernie-3.5-8k, ernie-4.0-turbo-8k, deepseek-v4-pro, GLM, Qwen, Kimi, GPT
SLA99.95% uptime guarantee

Ready to Build with QIANFAN?

Register and make your first API call in under 5 minutes

Register Now View Documentation