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

# Baidu Wenxin API — answers and sources from Baidu's China AI chat

> Ask Baidu Wenxin (文心), Baidu's AI chat in China, a question and get its answer, the pages it read and its search queries.

`BAIDU_WENXIN` asks Baidu's Wenxin chat (文心, wenxin.baidu.com) as a guest. It searches the web before answering, and no account or login is involved.

| | |
| - | - |
| taskType | `BAIDU_WENXIN` |
| Reads | `prompt` (falls back to `query`) |
| Credits | 1.25 |
| Country | **Ignored.** Every task asks from mainland China. |

## Request

Wenxin answers guests only from mainland China, so every task leaves from a mainland exit and `country` does not change it. You can omit it.

```bash theme={"theme":"css-variables"}
curl -X POST https://api.querying.ai/v1/async/task \
  -H "Authorization: Bearer $QUERYING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "taskType": "BAIDU_WENXIN", "payload": { "prompt": "上海有哪些适合周末去的博物馆" } }'
```

## Response

| Field | Type | Description |
| - | - | - |
| `text` | string | The answer. |
| `markdown` | string | The answer as Markdown. Returned without any flag. |
| `searchQueries` | string\[] | The searches Wenxin ran before answering. |
| `sources` | array | The pages Wenxin read: `position`, `url`, `label`, `source` (the site name). |
| `rawResponse` | object | Cards shown with the answer (places, products, images) as `components`. Only with `include.rawResponse`. |

The answer text carries no citation marks: `sources` lists what Wenxin read, not what it cited. A typical answer reads about 30 pages.

For example:

```json theme={"theme":"css-variables"}
{
  "text": "上海适合周末去的博物馆有上海博物馆东馆 ...",
  "markdown": "上海适合周末去的博物馆有**上海博物馆东馆** ...",
  "searchQueries": ["上海 周末 博物馆 推荐"],
  "sources": [{ "position": 1, "url": "https://www.example.com/shanghai-museums", "label": "上海博物馆推荐", "source": "example.com" }]
}
```

## Include flags

| Flag | Effect |
| - | - |
| `rawResponse` | Adds `rawResponse`. |

`markdown` and `searchQueries` need no flag. `ads` and `shopping` have no effect. `analysis` is rejected with `422 VALIDATION_ERROR`, `citationAnalysis` with `400 VALIDATION_ERROR` and `html` with `422 EVIDENCE_UNSUPPORTED`. See [Markdown and raw responses](https://docs.querying.ai/engines/response-options.md).

## Related

* [Baidu Wenxin product page](https://querying.ai/en/engines/baidu-wenxin)
* [Doubao](https://docs.querying.ai/engines/doubao.md)
* [Engine overview](https://docs.querying.ai/engines/overview.md)


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