provider

Baidu ERNIE

Direct answerDirect Qianfan access uses https://qianfan.baidubce.com/v2 and a Bearer bce-v3/... key. Preset models use the documented model parameter; custom deployments use a service API name, while this gateway uses its own token.

Updated · Reviewed

Qianfan versus ERNIE

The Qianfan catalog includes Baidu ERNIE and partner models, so not every listing belongs to ERNIE. Verify author, model parameter, and capability matrix. This gateway page declares only /v1/chat/completions; native Qianfan embedding, image, and other service APIs are not gateway routes by implication.

Direct access versus this gateway

Qianfan's V2 OpenAI-compatible base is https://qianfan.baidubce.com/v2, with Chat at https://qianfan.baidubce.com/v2/chat/completions, authenticated by a Bearer bce-v3/... API key. This gateway uses its own base URL, Bearer token, and enabled model name. Do not reuse stale V1 tutorials or send a Baidu key to this site.

Preset models versus custom services

A preset model uses the model parameter published in the model list, such as ernie-3.5-8k; a trained deployment or custom service uses its service API name. Console display names are for humans. Through this gateway, a channel may map an enabled gateway name to either value, so clients use only the public gateway name.

appid, streaming, and tools

An optional appid header supports usage and billing attribution, and an API key can be scoped to all resources or one appid. Text generation supports streaming and tools; model-generated function arguments still require application validation and execution. Response headers expose request and input/output token limits and remaining capacity for proactive throttling.

Errors, limits, and cost safety

A 429 can separately indicate RPM, aggregate TPM, input/output TPM, application QPS, or cluster limits, so combine the business code with rate-limit headers. Coding Plan has a dedicated key and must not be mixed with pay-as-you-go. Cap output, concurrency, and budget, alert on usage, retain request IDs, and use the current Qianfan pages for price and model status.

Reviewed provider catalog

Latest models by capability

These are provider-catalog models, not a promise of availability on this site. Confirm callable IDs, endpoints, and pricing in the model marketplace.

Text, reasoning, and code

  • ernie-5.1 Stable

    Baidu ERNIE's current flagship text model for complex reasoning, multimodal understanding, and agents.

    Release date not stated in the cited official source

Image generation and editing

Video generation and editing

Speech and audio

  • audio-realtime-near Preview

    Baidu's Pro near-field end-to-end speech-language model for realtime text and audio output, currently in public beta.

    Release date not stated in the cited official source
  • audio-realtime-far Preview

    Baidu's Pro far-field end-to-end speech-language model for distant capture, currently in public beta.

    Release date not stated in the cited official source

Embeddings, retrieval, and reranking

Check live availability in the model marketplace

Use cases

  • Chinese understanding and generation
  • Reasoning and multimodality
  • Enterprise and industry workloads

API protocols

  • /v1/chat/completions

FAQ

What base URL and API key does Qianfan V2 use?

For a direct OpenAI SDK, use https://qianfan.baidubce.com/v2; Chat is /v2/chat/completions, authenticated with a Bearer bce-v3/... key. Gateway calls instead use this site's base URL and token, never the Baidu key.

Should model contain an ERNIE display name or a custom service name?

A preset model uses the model parameter published in the Qianfan model list, such as the official ernie-3.5-8k example. A trained deployment or custom service uses its service API name. A console display title replaces neither.

Is appid required, and what does it do?

appid is not the primary authentication key; it is an optional header for application-level usage and billing attribution. API keys can also cover all resources or a specific appid, so production workloads should separate appids and keys for accountable billing.

How do I tell whether a Qianfan 429 is RPM or TPM?

Read the provider business code and response headers that report request, input-token, and output-token limits and remaining capacity. A 429 can also come from application QPS or cluster limits. Coding Plan uses a dedicated key that cannot be mixed with pay-as-you-go.

Official sources

  1. Baidu AI Cloud Qianfan Model List Official
  2. Baidu AI Cloud Qianfan Pricing Official
  3. Baidu AI Cloud Qianfan OpenAI SDK Quickstart Official
  4. Baidu AI Cloud Qianfan API Key Authentication Official
  5. Baidu AI Cloud Qianfan Text Generation API Official
  6. Baidu AI Cloud Qianfan Errors Official