> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Qianfan (Baidu)

> Connect WednesdayAI to Baidu's Qianfan platform for ERNIE and DeepSeek models.

# Qianfan (Baidu)

Qianfan is Baidu's MaaS platform that provides a unified OpenAI-compatible API for ERNIE and DeepSeek models. A single API key gives you access to all available models.

## Prerequisites

* A Baidu Cloud account with Qianfan API access enabled
* A Qianfan API key (format: `bce-v3/ALTAK-...`) from the [Qianfan Console](https://console.bce.baidu.com/qianfan/ais/console/apiKey)

## Quick setup

### 1. Get an API key

Sign in to the [Qianfan Console](https://console.bce.baidu.com/qianfan/ais/console/apiKey) and create an API key. Keys start with `bce-v3/ALTAK-`.

Store it on the gateway host:

```bash theme={"dark"}
echo 'QIANFAN_API_KEY=bce-v3/ALTAK-...' >> ~/.openclaw/.env
```

### 2. Run onboarding

```bash theme={"dark"}
openclaw onboard --auth-choice qianfan-api-key
```

Or non-interactive:

```bash theme={"dark"}
openclaw onboard --non-interactive \
  --mode local \
  --auth-choice qianfan-api-key \
  --qianfan-api-key "bce-v3/ALTAK-..."
```

### 3. Configure

```json5 theme={"dark"}
{
  models: {
    providers: {
      qianfan: {
        apiKey: "QIANFAN_API_KEY", // references the env var
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "qianfan/deepseek-v3.2" },
    },
  },
}
```

<Note>
  `apiKey` is the name of the environment variable, not the key value itself. Keep secrets in `.env`, not in committed config files.
</Note>

## Provider settings

| Setting      | Value                             |
| ------------ | --------------------------------- |
| Provider ID  | `qianfan`                         |
| Base URL     | `https://qianfan.baidubce.com/v2` |
| API          | OpenAI-compatible                 |
| Auth env var | `QIANFAN_API_KEY`                 |

## Verification

```bash theme={"dark"}
openclaw models status --probe-provider qianfan
```

## Available models

| Model ID                     | Context | Max tokens | Notes              |
| ---------------------------- | ------- | ---------- | ------------------ |
| `deepseek-v3.2`              | 98,304  | 32,768     | Default; reasoning |
| `ernie-5.0-thinking-preview` | 119,000 | 64,000     | Reasoning; vision  |

Use model IDs as `qianfan/<model-id>` — for example, `qianfan/deepseek-v3.2`.

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Verify your API key starts with `bce-v3/ALTAK-` and is copied in full. Re-run `openclaw onboard --auth-choice qianfan-api-key` to refresh the stored credential.
  </Accordion>

  <Accordion title="Model not found">
    Confirm the model ID matches exactly (case-sensitive) and that your Qianfan account has access to the requested model.
  </Accordion>

  <Accordion title="API access not enabled">
    Ensure your Baidu Cloud account has Qianfan API access enabled in the console. Some model families require separate activation.
  </Accordion>
</AccordionGroup>

## Related

* [AI providers overview](/admin/providers/index)
* [Reference: config](/reference/config)
