Skip to content

Instantly share code, notes, and snippets.

@composite
Created February 27, 2025 13:44
Show Gist options
  • Save composite/560377678348449c91b653cbff345a93 to your computer and use it in GitHub Desktop.
Save composite/560377678348449c91b653cbff345a93 to your computer and use it in GitHub Desktop.
Grok3 API request with curl - UNOFFICIAL! Use at your own risk.
curl --location --request POST 'https://grok.com/rest/app-chat/conversations/new' \
--header 'accept: */*' \
--header 'accept-language: en-GB,en;q=0.9' \
--header 'content-type: application/json' \
--header 'origin: https://grok.com' \
--header 'priority: u=1, i' \
--header 'referer: https://grok.com/' \
--header 'sec-ch-ua: "Not/A)Brand";v="8", "Chromium";v="126", "Brave";v="126"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "macOS"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-gpc: 1' \
--header 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36' \
--cookie 'sso=GROK_COM_COOKIE_sso_VALUE' \ # obtain cookie 'sso' value yourself on https://grok.com
--cookie 'sso-rw=GROK_COM_COOKIE_sso_rw_VALUE' \ # obtain cookie 'sso' value yourself on https://grok.com
--data-raw '{
"temporary": false,
"modelName": "grok-3",
"message": "TYPE_YOUR_MESSAGE_HERE_YOU_WANT",
"fileAttachments": [],
"imageAttachments": [],
"disableSearch": false,
"enableImageGeneration": true,
"returnImageBytes": false,
"returnRawGrokInXaiRequest": false,
"enableImageStreaming": true,
"imageGenerationCount": 2,
"forceConcise": false,
"toolOverrides": {},
"enableSideBySide": true,
"isPreset": false,
"sendFinalMetadata": true,
"customInstructions": "",
"deepsearchPreset": "",
"isReasoning": false
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment