LLM ReferenceLLM Reference

Using ERNIE 5.1 on Baidu Qianfan

Implementation guide · ERNIE 5 · Baidu AI

Serverless

Quick Start

  1. 1
    Create an account at Baidu Qianfan and generate an API key.
  2. 2
    Use the Baidu Qianfan SDK or REST API to call ernie-5.1 — see the documentation for request format.
  3. 3
    You'll be billed $0.59/1M input, $2.65/1M output tokens. See full pricing.

Code Examples

See Baidu Qianfan documentation for integration details.

About Baidu Qianfan

Baidu Qianfan provides native hosted access to Baidu's ERNIE model lineup, including ERNIE 5.1, through model service APIs and the Qianfan console. The platform documents OpenAI-compatible access patterns, model lists, rate limits, and token-based pricing for online inference.

Baidu Qianfan is Baidu Intelligent Cloud's foundation model and Agent development platform, providing hosted API access to ERNIE and Qianfan models for text generation, reasoning, multimodal understanding, embeddings, and agent workflows.

Pricing on Baidu Qianfan

TypePrice (per 1M)
Input tokens$0.59
Output tokens$2.65

Capabilities

VisionMultimodalReasoningFunction CallingTool UseStructured OutputsCode Execution

About ERNIE 5.1

ERNIE 5.1 is Baidu's fifth-generation flagship language model, officially released May 9, 2026. Achieved via disaggregated fully-asynchronous reinforcement learning and scaled agentic post-training, it delivers leading performance at approximately 6% of the pre-training compute cost of comparable models — with roughly one-third the total parameters and half the active parameters of ERNIE 5.0. ERNIE 5.1 ranks #4 globally and #1 among Chinese models on the LMArena Search leaderboard (score: 1,223), with standout performance in legal reasoning, mathematics (AIME26: 99.6), and business domains. API model ID: ernie-5.1. Context: 128K tokens; max output: 65,536 tokens.

Model Specs

Released2026-05-09
Context128k

More Models on Baidu Qianfan

Provider

Baidu Qianfan

Baidu

Beijing, China