twexapi-io Grok Endpoints API

The Grok Endpoints API from twexapi-io — 3 operation(s) for grok endpoints.

Operations 3

POST /v3/twitter/grok/ask Ask Grok #
POST /v3/twitter/grok/history Get Grok History #
POST /v3/twitter/grok/conversation Get Grok Conversation #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/twexapi-io:twexapi-io-grok-endpoints-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

twexapi-io-grok-endpoints-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: TwexAPI REST Grok Endpoints API
  description: 'TwexAPI exposes a REST API at `https://api.twexapi.io` for X/Twitter search, profiles, followers, posting, DMs, and agent integrations.


    **Capabilities include:**


    * **Search** — Advanced search, hashtags, cashtags

    * **Tweets** — Post, like, retweet, quote, bookmark, delete

    * **Users** — Batch user information retrieval

    * **Influencers** — Get tweets from top influencers


    All endpoints return a consistent envelope with `code`, `msg`, and `data` fields. See Error Handling for status codes and recovery.


    ## Authentication


    Send your API key on every request:


    ```txt

    Authorization: Bearer YOUR_API_KEY

    ```


    Write actions also require a Twitter cookie or `auth_token`. See Authentication for setup examples.'
  contact:
    name: TwexAPI Support
    email: support@twexapi.io
  license:
    name: MIT
  version: 1.0.0
servers:
- url: https://api.twexapi.io
  description: Development server
tags:
- name: Grok Endpoints
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: []
  /v3/twitter/grok/history:
    post:
      tags:
      - Grok Endpoints
      summary: Get Grok History
      description: Get Grok conversation history list.
      operationId: grok_history_api_v3_twitter_grok_history_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokHistoryQuery'
        required: true
      responses:
        '200':
          description: A list of Grok conversations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GrokHistoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /v3/twitter/grok/conversation:
    post:
      tags:
      - Grok Endpoints
      summary: Get Grok Conversation
      description: Get Grok conversation detail by conversation id.
      operationId: grok_conversation_api_v3_twitter_grok_conversation_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GrokConversationQuery'
        required: true
      responses:
        '200':
          description: Grok conversation messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GrokConversationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
components:
  schemas:
    GrokConversationItem:
      properties:
        chat_item_id:
          type: string
          title: Chat Item Id
          description: Chat item id
          example: '2063977852924837888'
        message:
          anyOf:
          - type: string
          - type: 'null'
          title: Message
          description: Message content
        sender_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Sender Type
          description: 'Sender type: User or Agent'
          example: User
        created_at_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Created At Ms
          description: Created at timestamp in ms
        grok_mode:
          anyOf:
          - type: string
          - type: 'null'
          title: Grok Mode
          description: Grok mode
          example: Normal
        thinking_trace:
          anyOf:
          - type: string
          - type: 'null'
          title: Thinking Trace
          description: Thinking trace text
        image_urls:
          items:
            type: string
          type: array
          title: Image Urls
          description: Generated image urls from card attachments
      type: object
      required:
      - chat_item_id
      title: GrokConversationItem
      description: Grok conversation message item
    GrokConversationResponse:
      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/GrokConversationData'
          - type: 'null'
          description: Grok conversation detail
      type: object
      required:
      - code
      - msg
      title: GrokConversationResponse
      description: Response for Grok conversation detail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    GrokHistoryQuery:
      properties:
        count:
          anyOf:
          - type: integer
            maximum: 100
            minimum: 1
          - type: 'null'
          title: Count
          description: Number of conversations to return.
          default: 20
          example: 20
        cookie:
          type: string
          title: Cookie
          description: The 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).
          example: ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7
        proxy:
          anyOf:
          - type: string
          - type: 'null'
          title: Proxy
          description: 'Optional HTTP proxy. Example: http://username:password@ip:port'
          example: http://username:password@ip:port
      type: object
      required:
      - cookie
      title: GrokHistoryQuery
      description: Parameters for getting Grok conversation history list
    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
    GrokConversationData:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
          description: Grok conversation rest id
        is_pinned:
          type: boolean
          title: Is Pinned
          description: Whether the conversation is pinned
          default: false
        cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
          description: Pagination cursor
        items:
          items:
            $ref: '#/components/schemas/GrokConversationItem'
          type: array
          title: Items
          description: Conversation items
      type: object
      required:
      - conversation_id
      title: GrokConversationData
      description: Grok conversation detail payload
    GrokHistoryItem:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
          description: Grok conversation id
          example: '2076320454898278729'
        id:
          anyOf:
          - type: string
          - type: 'null'
          title: Id
          description: Grok conversation id (alternate)
        title:
          type: string
          title: Title
          description: Conversation title
          example: Friendly greeting
        created_at_ms:
          anyOf:
          - type: integer
          - type: 'null'
          title: Created At Ms
          description: Created at timestamp in ms
          example: 1783868347485
        is_pinned:
          type: boolean
          title: Is Pinned
          description: Whether the conversation is pinned
          default: false
      type: object
      required:
      - conversation_id
      - title
      title: GrokHistoryItem
      description: Grok conversation history item
    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
    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
    GrokHistoryResponse:
      properties:
        code:
          type: integer
          title: Code
          description: Response code
          example: 200
        msg:
          type: string
          title: Msg
          description: Response message
          example: success
        data:
          items:
            $ref: '#/components/schemas/GrokHistoryItem'
          type: array
          title: Data
          description: Grok conversation list
      type: object
      required:
      - code
      - msg
      - data
      title: GrokHistoryResponse
      description: Response for Grok conversation history list
    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: The 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).
          example: ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7
        proxy:
          anyOf:
          - type: string
          - type: 'null'
          title: Proxy
          description: 'Optional HTTP proxy. Example: http://username:password@ip:port'
          example: http://username:password@ip:port
      type: object
      required:
      - prompt
      - cookie
      title: GrokAskQuery
      description: Parameters for asking Grok
    GrokConversationQuery:
      properties:
        conversation_id:
          type: string
          title: Conversation Id
          description: Grok conversation rest id.
          example: '2063972906435248338'
        cookie:
          type: string
          title: Cookie
          description: The 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).
          example: ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7
        proxy:
          anyOf:
          - type: string
          - type: 'null'
          title: Proxy
          description: 'Optional HTTP proxy. Example: http://username:password@ip:port'
          example: http://username:password@ip:port
      type: object
      required:
      - conversation_id
      - cookie
      title: GrokConversationQuery
      description: Parameters for getting a Grok conversation detail
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer