Grok

Query xAI's Grok via Wire — the answer plus the web sources it cited

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

Run a prompt against xAI's Grok and get the answer with the web sources it used. Grok runs on your own connected account (auth_mode: "required") — pass its credential_id. Run it with the grok_prompt action on POST /v1/wire/task.

Catalog: grok · action_id: grok_prompt · Credits: 10 / call · Auth: required


Request Body

{
  "action_id": "grok_prompt",
  "credential_id": "11111111-2222-3333-4444-555555555555",
  "params": { "prompt": "best CRM for small teams", "model": "fast" }
}
ParameterTypeDescription
action_id requiredstringSet to grok_prompt
credential_id requiredstring (UUID)Your connected Grok account — from GET /v1/wire/identities
params.prompt requiredstringYour question for Grok (≤ 16384 chars)
params.modelstringfast (Grok 3), expert (Grok 4), or auto. Default fast
params.timeoutnumberMax seconds to wait for the answer. Default 90

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": "grok_prompt",
    "credential_id": "11111111-2222-3333-4444-555555555555",
    "params": { "prompt": "best CRM for small teams", "model": "fast" }
  }'

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": 10,
  "data": {
    "status": "ok",
    "data": {
      "prompt": "…", "model": "fast", "web_search": true,
      "answer_text": "…", "answer_complete": true,
      "sources": [ { "url": "https://…", "title": "…" } ],
      "conversation_id": "…", "account_email": "…", "accounts_tried": 1, "prompt_sent_at": "…"
    },
    "meta": { "action_id": "grok_prompt", "catalog_slug": "grok", "envelope_version": "v1" }
  }
}
FieldTypeDescription
data.data.answer_textstringThe answer
data.data.answer_completebooleanWhether the stream finished within timeout
data.data.sourcesarrayWeb sources cited — { url, title }
data.data.modelstringThe Grok model used
data.data.conversation_idstringThe Grok conversation id

Auth required — omitting credential_id returns 401 AUTH_REQUIRED. Premium engine: 10 credits/call. model: "expert" uses Grok 4 (slower, deeper). Billed only on success.