Skip to content

How to Connect Qianfan Models to OpenClaw

I often find myself juggling too many API keys and endpoints when I want to test different AI models. It gets frustrating when every new provider requires a different SDK or a complex configuration change just to see if a model fits my needs. I prefer a setup where I can access various models through a single, consistent interface without the headache of rewriting my core logic.

Baidu’s Qianfan platform helps with this by providing a unified API. Since it is OpenAI-compatible, I can use it with existing tools by simply switching the base URL. Here is how I get it running with OpenClaw.

  • A Baidu Cloud account with Qianfan API access and a generated API key.
  • OpenClaw installed on your system.

Setting this up takes less than five minutes. I follow these steps to get the API key and configure the CLI.

  1. Visit the Qianfan Console.
  2. Create a new application or select an existing one from your list.
  3. Generate an API key. You will see a format like bce-v3/ALTAK-....
  4. Copy the key and run the following command in your terminal:
Terminal window
openclaw onboard --auth-choice qianfan-api-key

The source documentation does not list specific error codes for this provider. I find that using the openclaw onboard command is the best way to avoid manual configuration mistakes, as it guides the setup process directly. If the CLI does not recognize your key, I recommend double-checking that the key follows the bce-v3/ALTAK-... format required by Baidu.

If you run into other specific issues, you can ask the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.