Grok API | Ask X's In-App Grok, With Its Citations
Grok: Ask X's own in-app Grok a question and get the answer back with the pages it cited. Grok reads X in real time, so it answers about posts and accounts a general model has never seen. Runs as your account, returns one buffered JSON document rather than a stream, and stores nothing: you pass prior turns back yourself.
Ask X's own in-app Grok a question and get the answer back with the pages it cited. Grok reads X in real time, so it answers about posts and accounts a general model has never seen. Runs as your account, returns one buffered JSON document rather than a stream, and stores nothing: you pass prior turns back yourself.
This category has 4 endpoints. Each is a pay-per-call REST endpoint with bearer auth, JSON in and out.
| Method | Path | Cost | Description |
|---|---|---|---|
POST | /grok/chat | $0.0040 | Ask X's Grok a question and get the answer plus the pages it cited. |
GET | /grok/config | Free | Check whether your account can use Grok, and which models it may pick. |
POST | /grok/chat/submit | Free | Start a Grok chat in the background and get a job id to poll, for clients that time out before a long answer. |
GET | /grok/chat/result | Free | Poll a submitted Grok chat: pending, the finished answer, or the error grok/chat would have returned. |
Grok Chat
Ask X's Grok a question and get the answer plus the pages it cited.
Grok Config
Check whether your account can use Grok, and which models it may pick.
Grok Chat: Submit
Start a Grok chat in the background and get a job id to poll, for clients that time out before a long answer.
Grok Chat: Result
Poll a submitted Grok chat: pending, the finished answer, or the error grok/chat would have returned.
Space Info GET
Look up a single X Space by its id and get back its title, lifecycle state, host, topics, timing, audience counts and its admin, speaker and listener roster. Works for a Space that is scheduled, running or already ended. Billed at $0.0008 per call. Cost: $0.0008 per call.
Grok Chat POST
Send a prompt to X's in-app Grok as the account behind your session and get back one complete JSON document: the answer text, the web pages Grok cited while writing it, and the searches it ran to find them. Grok reads X in real time, so it answers about posts and accounts a general-purpose model has never seen. Send a bare post URL as the message and you get a structured summary of that post instead, including what Grok reads out of its attached images. Billed at $0.0040 per answer. Cost: $0.0040 per call.