> ## 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

# Qianfan

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.

## Requirements

* 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)

## Quickstart

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

Or non-interactive:

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

## Configuration

### Environment variable

```bash theme={"dark"}
export QIANFAN_API_KEY="bce-v3/ALTAK-..."
```

### Config snippet

```json5 theme={"dark"}
{
  env: { QIANFAN_API_KEY: "bce-v3/ALTAK-..." },
  agents: {
    defaults: {
      model: { primary: "qianfan/deepseek-v3.2" },
    },
  },
}
```

### Provider settings

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

## Available models

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

Use model IDs as `qianfan/<model-id>` (example: `qianfan/deepseek-v3.2`).

## Troubleshooting

**401 Unauthorized**

* Verify your API key starts with `bce-v3/ALTAK-` and is copied in full.
* Re-run `wednesdayai onboard --auth-choice qianfan-api-key` to refresh the stored credential.

**Model not found**

* Confirm the model ID matches exactly (case-sensitive).
* Check that your Qianfan account has access to the requested model.

## Related

* [Model providers](https://docs.wednesdayai.dev/next/developers/concepts/model-providers.md)
* [Models](https://docs.wednesdayai.dev/next/developers/concepts/models.md)
* [Gateway configuration](https://docs.wednesdayai.dev/next/admin/gateway/configuration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.