Wenxin (ERNIE)
Query Baidu's Wenxin / ERNIE via Wire — China's leading AI assistant, with citations
POST
https://api.anakin.io/v1/wire/taskWenxin (文心一言 / ERNIE) is Baidu's AI assistant. Send a prompt in any language and get the answer with its citations and web sources. Run it with the wenxin_prompt action on POST /v1/wire/task.
Catalog: wenxin · action_id: wenxin_prompt · Credits: 2 / call · Auth: none
Request Body
{
"action_id": "wenxin_prompt",
"params": { "prompt": "What are the best running shoes in 2026?" }
}| Parameter | Type | Description |
|---|---|---|
action_id required | string | Set to wenxin_prompt |
params.prompt required | string | Your question for ERNIE (up to 8192 chars, any language) |
params.additional_prompt | string | Optional follow-up, asked as a second turn |
params.include_html | boolean | Also return the answer as HTML under answer_html. Default false |
Code Examples
curl -X POST https://api.anakin.io/v1/wire/task \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"action_id": "wenxin_prompt",
"params": { "prompt": "What are the best running shoes in 2026?" }
}'import requests
res = requests.post(
'https://api.anakin.io/v1/wire/task',
headers={'X-API-Key': 'your_api_key'},
json={'action_id': 'wenxin_prompt', 'params': {'prompt': 'What are the best running shoes in 2026?'}},
)
job_id = res.json()['job_id']const res = await fetch('https://api.anakin.io/v1/wire/task', {
method: 'POST',
headers: { 'X-API-Key': 'your_api_key', 'Content-Type': 'application/json' },
body: JSON.stringify({
action_id: 'wenxin_prompt',
params: { prompt: 'What are the best running shoes in 2026?' },
}),
});
const { job_id } = await res.json();Response
202 Accepted{ "status": "processing", "job_id": "…", "poll_url": "/v1/wire/jobs/…" }Poll GET /v1/wire/jobs/{id} until status: "completed":
{
"status": "completed",
"credits_used": 2,
"data": {
"status": "ok",
"data": {
"prompt": "…", "title": "…",
"answer_text": "…", "answer_text_markdown": "…", "answer_html": "…",
"citations": [], "search_sources": [], "references": [],
"related_media": [], "recommendations": [],
"conversation_id": "…", "response_id": "…", "language": "zh", "detected_location": "…", "model": "…"
},
"meta": { "action_id": "wenxin_prompt", "catalog_slug": "wenxin", "envelope_version": "v1" }
}
}| Field | Type | Description |
|---|---|---|
data.data.answer_text | string | The answer (also answer_text_markdown, and answer_html when include_html) |
data.data.citations | array | Sources cited in the answer |
data.data.search_sources | array | Sources considered during search |
data.data.language | string | Detected answer language |
Handles any language, strongest on Chinese-language queries.
additional_promptruns a second conversational turn. Billed only on success.