> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twexapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask Grok

> Ask Grok with a Twitter account cookie.



## OpenAPI

````yaml /api-reference/openapi.json post /v3/twitter/grok/ask
openapi: 3.1.0
info:
  title: Twitter API Service
  description: |2-

            A comprehensive Twitter API service that provides various Twitter operations including:
            
            * **Search Operations**: Advanced search, hashtags, cashtags
            * **Tweet Operations**: Post, like, retweet, quote, bookmark, delete
            * **User Operations**: Batch user information retrieval
            * **Influencer Operations**: Get tweets from top influencers
            
            All endpoints return standardized responses in the format:
            ```json
            {
                "code": 200,
                "msg": "success", 
                "data": {...}
            }
            ```
            
            ## Authentication
            
            This API uses Bearer token authentication. Include your token in the Authorization header:
            ```
            Authorization: Bearer your_token_here
            ```
            
  contact:
    name: API Support
    email: support@twitterxapi.com
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twexapi.io
    description: Development server
security: []
paths:
  /v3/twitter/grok/ask:
    post:
      tags:
        - Grok Endpoints
      summary: Ask Grok
      description: Ask Grok with a Twitter account cookie.
      operationId: grok_ask_api_v3_twitter_grok_ask_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokAskQuery'
        required: true
      responses:
        '200':
          description: Grok response result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GrokAskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    GrokAskQuery:
      properties:
        prompt:
          type: string
          title: Prompt
          description: User prompt.
          example: Say hi in one sentence.
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
          description: Continue an existing Grok conversation.
          example: '2076320454898278729'
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: Optional model id (default grok-3-latest).
          default: grok-3-latest
          example: grok-3-latest
        cookie:
          type: string
          title: Cookie
          description: >-
            Twitter authentication cookie or Twitter auth_token,
            [how-to-get-twitter-cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie)
          example: ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7
        proxy:
          anyOf:
            - type: string
            - type: 'null'
          title: Proxy
          description: 'Proxy ref for session. Example: http://username:password@ip:port'
          example: http://username:password@ip:port
      type: object
      required:
        - prompt
        - cookie
      title: GrokAskQuery
      description: Parameters for asking Grok
    GrokAskResponse:
      properties:
        code:
          type: integer
          title: Code
          description: Response code
          example: 200
        msg:
          type: string
          title: Msg
          description: Response message
          example: success
        data:
          anyOf:
            - $ref: '#/components/schemas/GrokAskResult'
            - type: 'null'
          description: Grok result
      type: object
      required:
        - code
        - msg
      title: GrokAskResponse
      description: Response for asking Grok
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GrokAskResult:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
          description: Grok conversation id
          example: '2076320454898278729'
        user_chat_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Chat Item Id
          description: User chat item id
        agent_chat_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Chat Item Id
          description: Agent chat item id
        message:
          type: string
          title: Message
          description: Final assistant message
          example: Hi there!
        reasoning:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning
          description: Reasoning text
          example: Thinking about your request
        soft_stop:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Soft Stop
          description: Whether response soft-stopped
        follow_up_suggestions:
          items:
            $ref: '#/components/schemas/GrokFollowUpSuggestion'
          type: array
          title: Follow Up Suggestions
          description: Follow-up suggestions
      type: object
      required:
        - conversation_id
        - message
      title: GrokAskResult
      description: Grok ask result
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    GrokFollowUpSuggestion:
      properties:
        label:
          type: string
          title: Label
          description: Suggestion label
          example: Learn about conversational AI
        properties:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Properties
          description: Suggestion properties
        tools_overrides:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Tools Overrides
          description: Tools overrides
      type: object
      required:
        - label
      title: GrokFollowUpSuggestion
      description: Grok follow-up suggestion
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````