ERNIE API
Baidu's ERNIE models through its Qianfan platform, with an OpenAI-compatible API on Baidu AI Cloud's international and mainland China sites.
7 open-source projects declare ERNIE API in their code; no maker's live product we track uses it yet.
Profile checked
- Oct 2026 Now covered: ERNIE API, for llm api.
How makers use ERNIE API
What ERNIE API is used for
ERNIE API vs the alternatives makers chose
| Option | Makers' products | 2026 launches | Free for | At 10,000 users | Open source | |
|---|---|---|---|---|---|---|
| 736 80% | 77% | ~1,000 users | $10/mo · GPT-6 Luna | No | ||
| 252 27% | 21% | ~1,000 users | $10/mo · Claude Haiku 5.5 | No | ||
| 99 11% | 12% | ~360 users | $28/mo · Gemini 3.1 Flash-Lite | No | ||
| 39 4% | 3% | ~1,500 users | $6.75/mo · GPT OSS 20B | No | ||
| 22 2% | 0% | — | — | No | ||
| 15 2% | 1% | ~1,700 users | $6.00/mo · Ministral 3 (3B) | No | ||
| ERNIE API | 0 0% | 0% | ~1,000 users | — | No |
For LLM API: how many of the 923 makers' products we know the LLM API of chose each option, and the share among the 256 launched in 2026, since a tool that came first has products from every year, and what each costs at 10,000 users.
Costs are the cheapest plan that fits, from each vendor's pricing page, at the usage our stack planner assumes for a product with that many users. Free for: the users its cheapest plan a business can use stays free for.
When to use ERNIE API, and when not
Something else fits better if
- You want the strongest general models and the widest ecosystem of examples and integrations: OpenAI API or Claude or Gemini API.
- Token cost dominates your budget, for example high-volume batch or agent workloads: DeepSeek or Groq or Mistral AI.
- You want to try or mix many models with one key and one bill, and fall back when a provider is down: OpenRouter.
- You want that routing and spend control but self-hosted, with keys and logs on your servers: LiteLLM.
The ERNIE API is how you call Baidu's ERNIE models: ERNIE 5.1 and 5.0, with 128K tokens of context and thinking and vision variants, and the cheaper ERNIE 4.5 Turbo models. They're served through Qianfan, Baidu AI Cloud's model platform, which also includes an agent and app builder; the mainland site resells third-party models such as DeepSeek and GLM as well. There's an international site (intl.cloud.baidu.com) and a mainland China site with prices in yuan.
More about ERNIE API
On the international site, the chat API is OpenAI-compatible: point the OpenAI SDK at https://api.baiduqianfan.ai/v1 and send a Qianfan API key as a bearer token. The same key can be scoped to Qianfan's app builder and other AI services. Baidu also publishes its own Qianfan SDKs for Python and JavaScript.
Useful for a small team: ERNIE 4.5 Turbo lists at $0.11 per million input tokens on the international site, and Baidu has published the ERNIE 4.5 family as open weights on Hugging Face under Apache 2.0, so you can serve those models yourself. The hosted ERNIE 5.x models are billed at a higher rate for prompts over 32K tokens.
Limits: Baidu Holdings Limited runs the international platform, and its agreement says your data may be processed in other countries where its affiliates or partners run Qianfan facilities. It also tells you not to submit confidential information and says Baidu has no confidentiality obligation over your content.
Who uses it
No maker's live product on record yet, and 7 open-source projects that declare it in their code.
We haven't found a maker's live product that uses ERNIE API yet — only the open-source projects below, which declare it in their code.
None of these in makers' own words.
Open source: a project that declares ERNIE API as a dependency in its public code — verifiable, but not necessarily a live product.
Alternatives to ERNIE API
All alternatives by situation →Further reading
Questions makers ask about ERNIE API
What are the alternatives to ERNIE API?
For LLM API, the other options makers' products we track chose most are OpenAI API (736), Claude (252), Gemini API (99), Groq (39), Azure OpenAI (22), Mistral AI (15). Each alternative, with the situation it fits, is on the ERNIE API alternatives page.
Can I use the OpenAI SDK?
Yes. Set the base URL to https://api.baiduqianfan.ai/v1 and pass your Qianfan API key (it starts with bce-v3/) as the API key. An optional appid header ties calls to a Qianfan app. source ↗
Does Baidu use my inputs and outputs?
The user agreement says inputs, outputs and uploaded datasets are your data, for use under your account, and that beyond performing the service Baidu won't make unauthorized use or disclosure of them. It doesn't separately address model training. source ↗
Where is my data processed?
Not in a fixed region. The agreement says data may be processed in countries where Qianfan facilities run by Baidu's affiliates or partners are located, which can mean cross-border transfers, and that you're responsible for your end users' consent to them. source ↗
Can I send confidential data?
The agreement says you shouldn't provide confidential information to the service, that Baidu has no confidentiality obligation over your content, and that it has no obligation to keep copies of it. source ↗
How is usage priced?
Per token, by model. ERNIE 5.1 and 5.0 have two input-length tiers, up to 32K tokens and 32K–128K, with the longer tier costing more for both input and output. source ↗
How much does ERNIE API cost?
Paid use starts at Pay per token. source ↗
Is ERNIE API open source or self-hostable?
Not open source, and hosted only.
Can AI coding agents work with ERNIE API?
No llms.txt, official MCP server or CLI found yet.
Who uses ERNIE API?
No maker's live product we track yet; 7 open-source projects declare it in their code. source ↗