Wenxin (ERNIE)

Query Baidu's Wenxin / ERNIE via Wire — China's leading AI assistant, with citations

POSThttps://api.anakin.io/v1/wire/task

Wenxin (文心一言 / 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?" }
}
ParameterTypeDescription
action_id requiredstringSet to wenxin_prompt
params.prompt requiredstringYour question for ERNIE (up to 8192 chars, any language)
params.additional_promptstringOptional follow-up, asked as a second turn
params.include_htmlbooleanAlso 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?" }
  }'

Response

202 Accepted
{ "status": "processing", "job_id": "…", "poll_url": "/v1/wire/jobs/…" }

Poll GET /v1/wire/jobs/{id} until status: "completed":

200 OK
{
  "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" }
  }
}
FieldTypeDescription
data.data.answer_textstringThe answer (also answer_text_markdown, and answer_html when include_html)
data.data.citationsarraySources cited in the answer
data.data.search_sourcesarraySources considered during search
data.data.languagestringDetected answer language

Handles any language, strongest on Chinese-language queries. additional_prompt runs a second conversational turn. Billed only on success.