Ask Grok
Ask Grok with a Twitter account cookie.
Back to API Reference
/Grok Endpoints
POST
/v3/twitter/grok/askAuthorization
AuthorizationBearer token · headerrequiredGlobal API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Request Body
requiredapplication/jsonpromptstringrequiredUser prompt.
conversation_idstring | anyContinue an existing Grok conversation.
Show propertiesHide properties
Any of:
string
stringany
anymodelstring | anyOptional model id (default grok-3-latest).
default: "grok-3-latest"
Show propertiesHide properties
Any of:
string
stringany
anycookiestringrequiredThe user's own authorized Twitter session credentials or auth_token (BYOC — Bring Your Own Cookie). Stateless proxy execution with zero credential retention. See [Authentication Security](/authentication#write-operations--byoc-bring-your-own-cookie) and [How to get Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
proxystring | anyOptional HTTP proxy. Example: http://username:password@ip:port
Show propertiesHide properties
Any of:
string
stringany
anyResponses
200Grok response result.
codeintegerrequiredResponse code
msgstringrequiredResponse message
dataGrokAskResult | anyGrok result
Show propertiesHide properties
Any of:
GrokAskResult
conversation_idstringrequiredGrok conversation id
user_chat_item_idstring | anyUser chat item id
Show propertiesHide properties
Any of:
string
stringany
anyagent_chat_item_idstring | anyAgent chat item id
Show propertiesHide properties
Any of:
string
stringany
anymessagestringrequiredFinal assistant message
reasoningstring | anyReasoning text
Show propertiesHide properties
Any of:
string
stringany
anysoft_stopboolean | anyWhether response soft-stopped
Show propertiesHide properties
Any of:
boolean
booleanany
anyfollow_up_suggestionsGrokFollowUpSuggestion[]Follow-up suggestions
Show propertiesHide properties
Array of
GrokFollowUpSuggestionlabelstringrequiredSuggestion label
propertiesobject | anySuggestion properties
Show propertiesHide properties
Any of:
object
objectany
anytools_overridesobject | anyTools overrides
Show propertiesHide properties
Any of:
object
objectany
anyany
any422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequiredinputanyctxobject⚡Interactive ConsolePOST
⚡Interactive Console / Try APIPOSTLive Console
🌐Target Server:
https://api.twexapi.io● Production Ready
✍️
Write Operation Credentials Guide (TwexAPI Key + Twitter Cookie)
1. TwexAPI Platform Key (Bearer Token): Enter under "API Authorization" below for request billing & authentication.
2. Twitter Account Cookie: For write operations (tweet, like, follow, etc.), provide the target Twitter account's Cookie (e.g. auth_token=...; ct0=...) in the cookie field of Request Body below.
🔑API Authorization
📝Request Bodyapplication/json
📡
No Response Yet
Configure parameters in the Request tab and click Send Request below.
Request
curl -X POST "https://api.twexapi.io/v3/twitter/grok/ask" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Say hi in one sentence.",
"conversation_id": "2076320454898278729",
"model": "grok-3-latest",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
}'const response = await fetch("https://api.twexapi.io/v3/twitter/grok/ask", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"prompt": "Say hi in one sentence.",
"conversation_id": "2076320454898278729",
"model": "grok-3-latest",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
})
});import requests
response = requests.post(
"https://api.twexapi.io/v3/twitter/grok/ask",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"prompt": "Say hi in one sentence.",
"conversation_id": "2076320454898278729",
"model": "grok-3-latest",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
},
)Response
{
"code": 200,
"msg": "success",
"data": {
"conversation_id": "2076320454898278729",
"user_chat_item_id": "string",
"agent_chat_item_id": "string",
"message": "Hi there!",
"reasoning": "Thinking about your request",
"soft_stop": true,
"follow_up_suggestions": [
{
"label": "Learn about conversational AI",
"properties": {},
"tools_overrides": {}
}
]
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}