Grok Chat Submit API | Start an Async Grok Answer
Start the same Grok chat as POST /twitter/grok/chat without holding the connection open. Send the same body and get a 202 with a job_id at once, then poll GET /twitter/grok/chat/result until the answer is ready. Built for clients that time out before a search-grounded answer arrives. A bad body, a missing key, a missing session and a short balance are answered on the spot, before any job exists, and at most 5 jobs per API key can be pending at once. Submitting is free: the $0.0040 grok/chat price is charged once, on the result poll that first delivers a finished answer, and a failed, timed-out, interrupted or never-collected job is not charged. Cost: Free per call.
POST grok/chat/submit starts the same Grok chat as grok/chat without holding the connection open. It answers 202 at once with a job_id, then you poll grok/chat/result. Submitting is free, and the $0.0040 grok/chat price is charged once, on the poll that first delivers the answer.
Authorization
bearerAuth Pass your API key as a bearer token on every request: Authorization: Bearer <API_KEY>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/grok/chat/submit" \ -H "Content-Type: application/json" \ -d '{}'{ "job_id": "5b0f6a52-3c7e-4f1a-9d2b-8e4c6a1f0b37", "status": "pending", "poll": "/twitter/grok/chat/result?job_id=5b0f6a52-3c7e-4f1a-9d2b-8e4c6a1f0b37", "poll_after_seconds": 3, "result_ttl_seconds": 900, "created_at": "2026-11-04T18:02:11.482Z"}{ "error": "bad_request", "message": "Missing or malformed parameter. Fix the request before retrying."}{ "error": "unauthorized", "message": "The API key is missing, malformed, or revoked. Check the Authorization header."}{ "error": "insufficient_credits", "message": "Your balance is exhausted. Top up your credits to continue.", "top_up_url": "https://www.twitterapis.com/dashboard/buy-credits?utm_source=api&utm_medium=402"}{ "error": "session_required", "message": "Register your Twitter session first: POST /twitter/customer/session with { auth_token, ct0 }, or pass them per call."}{ "error": "too_many_pending_jobs", "message": "This API key already has 5 Grok jobs running. Poll GET /twitter/grok/chat/result for one of them, then submit again.", "limit_pending": 5, "retry_after_seconds": 3}{ "error": "server_error", "message": "Something failed on our side. Retry with backoff; if it persists, contact support."}Pricing
| Unit | Price |
|---|---|
| Per call | Free |
Submitting is free. The $0.0040 grok/chat price is charged once, on the Grok Chat: Result poll that first delivers a finished answer. A job that fails, times out, is interrupted by a restart, or finishes and is never collected is not charged.
When to use
Reach for this when your client gives up before a search-grounded answer arrives, for example an agent tool call with a 30 second timeout. If your client can hold a connection for the whole answer, Grok Chat is one call instead of two. Call Grok Config first to confirm the account can use Grok at all.
Notes
- Needs a session for the account you are asking as: either register one once (POST /customer/session), or pass per-call inline credentials as x-auth-token and x-ct0 request headers. The chat runs in the background on your own X account, exactly as Grok Chat would run it.
- Answered on the spot, before any job exists: 400 for a bad body (the same bounds as Grok Chat, 20,000 characters and 100 prior turns), 401 for a missing key, 409 session_required when no session is registered, and 402 when the balance cannot cover the $0.0040 chat.
- At most 5 jobs per API key can be pending at once. A sixth submit gets 429 too_many_pending_jobs with retry_after_seconds, so poll one of the pending jobs first.
- The Location header and the poll field carry the same result path, with job_id already filled in.
Related endpoints
- Grok Chat: Result: 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.
FAQ
When should I use this instead of Grok Chat?
When your client cannot hold a connection for the whole answer. A search-grounded answer can run past the timeout of an agent tool call, and with Grok Chat that client sees a timeout for an answer we went on to produce. Submit hands back a job_id at once, so the wait moves into short polls. If your client can wait, Grok Chat is simpler and costs the same.
Does submitting cost anything?
No. Submit and every poll are free calls. The $0.0040 grok/chat price is charged once, on the poll that first delivers a finished answer, so a job that fails, times out or is never collected costs nothing. Your balance does have to cover $0.0040 when you submit, or you get a 402 before any job is created.
How many jobs can I run at once?
At most 5 pending jobs per API key. A sixth submit returns 429 too_many_pending_jobs with limit_pending and retry_after_seconds in the body. Finished jobs do not count, so collect one and submit again.
Do you keep my prompt or the answer?
We keep no prompt text. A finished answer is held for 15 minutes so you can collect it, then deleted whether or not you did. To continue a conversation, pass conversation_id and the prior turns back yourself in messages[], as on Grok Chat.
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.
Grok Chat: Result GET
Poll a job POST /twitter/grok/chat/submit started. While it runs you get a 202 with status pending and poll_after_seconds. When it finishes you get a 200 with exactly the body POST /twitter/grok/chat returns plus job_id and status done, and the fields projection works on it. If the chat failed you get the status and typed error grok/chat would have answered, plus job_id and status failed; 504 job_timeout and 503 job_interrupted mean the job did not finish on our side. An unknown job_id, a finished answer older than 15 minutes, or another key's job all return 404. The $0.0040 grok/chat price is charged once, on the first poll that delivers the finished answer; polling it again is free. Cost: Free per call.