{
  "openapi": "3.1.0",
  "info": {
    "title": "twit.sh — X/Twitter Data API",
    "description": "Payment-gated Twitter/X user and tweet lookup API. Pay per request in USDC on Base via x402.",
    "version": "1.0.0",
    "contact": {
      "url": "https://twit.sh"
    }
  },
  "servers": [
    {
      "url": "https://x402.twit.sh"
    }
  ],
  "components": {
    "securitySchemes": {
      "x402": {
        "type": "http",
        "scheme": "bearer",
        "description": "x402 payment protocol — pay USDC on Base per request"
      }
    }
  },
  "paths": {
    "/users/by/username": {
      "get": {
        "operationId": "getUserByUsername",
        "summary": "Look up user by screen name",
        "description": "Look up a Twitter/X user profile by their screen name. Returns full profile data including id, name, bio, follower counts, and verification status.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "required": true,
            "description": "Twitter screen name without @",
            "schema": {
              "type": "string",
              "example": "elonmusk"
            }
          }
        ]
      }
    },
    "/users/by/id": {
      "get": {
        "operationId": "getUserById",
        "summary": "Look up user by numeric ID",
        "description": "Look up a single Twitter/X user profile by their numeric user ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter user ID",
            "schema": {
              "type": "string",
              "example": "44196397"
            }
          }
        ]
      }
    },
    "/users/search": {
      "get": {
        "operationId": "searchUsers",
        "summary": "Search for users by keyword",
        "description": "Search Twitter/X for user accounts matching a keyword or phrase. Returns up to 20 users per page with pagination support.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Search keyword or phrase",
            "schema": {
              "type": "string",
              "example": "bitcoin"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/users/followers": {
      "get": {
        "operationId": "getUserFollowers",
        "summary": "Get followers for a user",
        "description": "Get the list of Twitter/X users who follow a specific user. Returns up to 50 follower profiles per page.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter user ID",
            "schema": {
              "type": "string",
              "example": "44196397"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/users/following": {
      "get": {
        "operationId": "getUserFollowing",
        "summary": "Get accounts a user follows",
        "description": "Get the list of Twitter/X users that a specific user follows. Returns up to 50 profiles per page.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter user ID",
            "schema": {
              "type": "string",
              "example": "44196397"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "operationId": "unfollowUser",
        "summary": "Unfollow a user",
        "description": "Causes the authenticated user to unfollow a specific user by their ID or username.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unfollow successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "following": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Numeric user ID to unfollow (one of id/username required)",
            "schema": {
              "type": "string",
              "example": "12"
            }
          },
          {
            "name": "username",
            "in": "query",
            "required": false,
            "description": "Screen name to unfollow (one of id/username required)",
            "schema": {
              "type": "string",
              "example": "jack"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "followUser",
        "summary": "Follow a user",
        "description": "Causes the authenticated user to follow a specific user by their ID or username.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0075"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Follow successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "following": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "description": "Numeric user ID to follow (one of id/username required)",
            "schema": {
              "type": "string",
              "example": "12"
            }
          },
          {
            "name": "username",
            "in": "query",
            "required": false,
            "description": "Screen name to follow (one of id/username required)",
            "schema": {
              "type": "string",
              "example": "jack"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/users/setProfile": {
      "post": {
        "operationId": "setProfile",
        "summary": "Update the authenticated user's profile",
        "description": "Updates the authenticated user's profile (bio, location, url, name). Requires Twitter/X session credentials. At least one profile field is required.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Profile updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "auth_token",
                  "ct0"
                ],
                "properties": {
                  "auth_token": {
                    "type": "string",
                    "description": "Twitter auth_token cookie value"
                  },
                  "ct0": {
                    "type": "string",
                    "description": "Twitter ct0 cookie value"
                  },
                  "bio": {
                    "type": "string",
                    "description": "Profile bio/description (optional)"
                  },
                  "location": {
                    "type": "string",
                    "description": "Profile location (optional)"
                  },
                  "url": {
                    "type": "string",
                    "description": "Profile website URL (optional)"
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name (optional)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/users": {
      "get": {
        "operationId": "getUsersByIds",
        "summary": "Bulk look up users by IDs",
        "description": "Bulk look up multiple Twitter/X user profiles by their numeric user IDs in a single request. Max 50 IDs.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": true,
            "description": "Comma-separated numeric Twitter user IDs, max 50",
            "schema": {
              "type": "string",
              "example": "9253672,44196397"
            }
          }
        ]
      }
    },
    "/tweets/quote_tweets": {
      "get": {
        "operationId": "getQuoteTweets",
        "summary": "Get quote tweets for a tweet",
        "description": "Retrieves a list of tweets that quote a specific tweet by its numeric ID. Includes author on each tweet. Paginated.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/communities/posts": {
      "get": {
        "operationId": "getCommunityPosts",
        "summary": "Get latest posts from a community",
        "description": "Retrieves the latest posts from a specific X Community. Includes author on each tweet. Not available in the official X API.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric community ID",
            "schema": {
              "type": "string",
              "example": "1693573582226665701"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/lists/members": {
      "get": {
        "operationId": "getListMembers",
        "summary": "Get list members",
        "description": "Get the members of a Twitter/X List by its numeric ID. Returns up to 100 user profiles per page with pagination.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter/X List ID",
            "schema": {
              "type": "string",
              "example": "84839422"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/lists/by/id": {
      "get": {
        "operationId": "getListById",
        "summary": "Get list details by ID",
        "description": "Retrieve details of a specific Twitter/X List by its numeric ID. Returns name, description, mode, member count, subscriber count, creation date, banner image, and owner profile.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter/X List ID",
            "schema": {
              "type": "string",
              "example": "84839422"
            }
          }
        ]
      }
    },
    "/lists/followers": {
      "get": {
        "operationId": "getListFollowers",
        "summary": "Get list followers",
        "description": "Retrieves a list of Users who follow a specific List by its ID. Returns up to 20 user profiles per page with pagination.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter/X List ID",
            "schema": {
              "type": "string",
              "example": "84839422"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/lists/tweets": {
      "get": {
        "operationId": "getListTweets",
        "summary": "Get list tweets",
        "description": "Get the latest tweets from a Twitter/X List by its numeric ID. Returns ~100 tweets per page with pagination.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric Twitter/X List ID",
            "schema": {
              "type": "string",
              "example": "84839422"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/communities/by/id": {
      "get": {
        "operationId": "getCommunityById",
        "summary": "Get community details by ID",
        "description": "Retrieve full details of a specific X Community by its numeric ID. Returns name, description, member count, join policy, topic, rules, banner image, and admin/creator profiles. Not available in the official X API.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric community ID",
            "schema": {
              "type": "string",
              "example": "1693573582226665701"
            }
          }
        ]
      }
    },
    "/communities/members": {
      "get": {
        "operationId": "getCommunityMembers",
        "summary": "Get members of a community",
        "description": "Retrieves a paginated list of users who are members of a specific X Community. Returns full user profiles with community role. Not available in the official X API.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric community ID",
            "schema": {
              "type": "string",
              "example": "1693573582226665701"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/retweeted_by": {
      "get": {
        "operationId": "getTweetRetweetedBy",
        "summary": "Get users who reposted a tweet",
        "description": "Retrieves a list of users who reposted a specific tweet by its numeric ID. Paginated.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/replies": {
      "get": {
        "operationId": "getTweetReplies",
        "summary": "Get replies to a tweet",
        "description": "Get paginated replies to a specific Twitter/X tweet by its numeric tweet ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/articles/by/id": {
      "get": {
        "operationId": "getArticleById",
        "summary": "Get full X Article content by tweet ID",
        "description": "Retrieve the full content of an X Article by the tweet ID of the post that hosts it. Returns article title, preview text, cover image, publish/modify dates, and full article_content as Markdown with headings, bold, italic, lists, and images. Not available in the official X API.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID of the X Article post",
            "schema": {
              "type": "string",
              "example": "2010751592346030461"
            }
          }
        ]
      }
    },
    "/tweets/by/id": {
      "get": {
        "operationId": "getTweetById",
        "summary": "Look up tweet by ID",
        "description": "Look up a single Twitter/X tweet by its numeric tweet ID. Returns full text, author, and engagement metrics.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          }
        ]
      }
    },
    "/tweets/user": {
      "get": {
        "operationId": "getUserTweets",
        "summary": "Get tweets from user timeline",
        "description": "Get the latest tweets from a specific user's timeline. Returns up to 20 tweets per page, most recent first.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "required": true,
            "description": "Twitter screen name (without @)",
            "schema": {
              "type": "string",
              "example": "elonmusk"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/mentions": {
      "get": {
        "operationId": "getMentions",
        "summary": "Get tweets mentioning the authenticated user",
        "description": "Get the latest tweets that mention the authenticated user (from the notifications timeline). Returns up to 20 tweets per page, most recent first.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.006"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Notifications timeline to read: All (default), Priority, or Mentions",
            "schema": {
              "type": "string",
              "enum": [
                "All",
                "Priority",
                "Mentions"
              ],
              "default": "All"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from previous response",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/search": {
      "get": {
        "operationId": "searchTweets",
        "summary": "Search tweets with advanced filters",
        "description": "Search Twitter/X tweets with advanced filters. At least one filter parameter is required.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.006"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "words",
            "in": "query",
            "required": false,
            "description": "All these words must appear",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phrase",
            "in": "query",
            "required": false,
            "description": "Exact phrase match",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "anyWords",
            "in": "query",
            "required": false,
            "description": "Any of these words",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "noneWords",
            "in": "query",
            "required": false,
            "description": "Exclude these words",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hashtags",
            "in": "query",
            "required": false,
            "description": "Filter by hashtag",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Tweets from this username",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Tweets replying to this username",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mentioning",
            "in": "query",
            "required": false,
            "description": "Tweets mentioning this username",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minReplies",
            "in": "query",
            "required": false,
            "description": "Minimum reply count",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minLikes",
            "in": "query",
            "required": false,
            "description": "Minimum like count",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minReposts",
            "in": "query",
            "required": false,
            "description": "Minimum retweet count",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "End date (YYYY-MM-DD)",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "next_token",
            "in": "query",
            "required": false,
            "description": "Pagination cursor",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/like": {
      "delete": {
        "operationId": "unlikeTweet",
        "summary": "Unlike a tweet",
        "description": "Causes the authenticated user to Unlike a specific Post by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unlike successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "liked": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to unlike",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "likeTweet",
        "summary": "Like a tweet",
        "description": "Causes the authenticated user to Like a specific Post by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0075"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Like successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "liked": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to like",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/bookmark": {
      "post": {
        "operationId": "bookmarkTweet",
        "summary": "Bookmark a tweet",
        "description": "Adds a Post to the authenticated user's Bookmarks by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bookmark added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "bookmarked": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to bookmark",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "operationId": "unbookmarkTweet",
        "summary": "Remove a bookmark",
        "description": "Removes a Post from the authenticated user's Bookmarks by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Bookmark removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "bookmarked": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to remove from bookmarks",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/tweets/retweet": {
      "delete": {
        "operationId": "unretweetTweet",
        "summary": "Unretweet a tweet",
        "description": "Causes the authenticated user to unrepost a specific Post by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.005"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Unretweet successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "retweeted": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to unretweet",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "retweetTweet",
        "summary": "Retweet a tweet",
        "description": "Causes the authenticated user to repost a specific Post by its ID.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0075"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Retweet successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "retweeted": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to retweet",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/workflows/userInsights": {
      "get": {
        "operationId": "getUserInsights",
        "summary": "Deep user intelligence workflow",
        "description": "Returns structured account metadata (location, verification status, blue check date, username history) alongside a month-by-month tweet volume breakdown for the past 12 months. Each month fetches up to 5 pages of search results. Useful for tracking posting cadence, identifying growth patterns, and building user profiles. Note: may take 30–90 seconds to complete.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.50"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "User insights",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "user": {
                          "type": "object",
                          "properties": {
                            "rest_id": {
                              "type": "string"
                            },
                            "screen_name": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "created_at": {
                              "type": "string"
                            },
                            "is_blue_verified": {
                              "type": "boolean"
                            },
                            "blue_verified_since": {
                              "type": "string",
                              "nullable": true
                            },
                            "account_based_in": {
                              "type": "string",
                              "nullable": true
                            },
                            "source": {
                              "type": "string",
                              "nullable": true
                            },
                            "username_changes_count": {
                              "type": "number"
                            },
                            "username_changes_last": {
                              "type": "string",
                              "nullable": true
                            }
                          }
                        },
                        "tweetCountPerMonth": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "number"
                          },
                          "example": {
                            "05-2026": 89,
                            "04-2026": 76,
                            "03-2026": 95
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found"
          }
        },
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "required": true,
            "description": "Twitter/X screen name (without @)",
            "schema": {
              "type": "string",
              "example": "elonmusk"
            }
          }
        ]
      }
    },
    "/tweets": {
      "delete": {
        "operationId": "deleteTweet",
        "summary": "Delete a tweet by ID",
        "description": "Deletes a specific Post by its ID, if owned by the authenticated user.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": true,
            "description": "Numeric tweet ID to delete",
            "schema": {
              "type": "string",
              "example": "1110302988"
            }
          },
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "operationId": "createTweet",
        "summary": "Create a new tweet or reply",
        "description": "Creates a new Post for the authenticated user, or replies to an existing post. Requires Twitter/X session credentials.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "auth_token",
                  "ct0"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Tweet content (max 280 characters). Optional when medias are attached (media-only post)."
                  },
                  "auth_token": {
                    "type": "string",
                    "description": "Twitter auth_token cookie value"
                  },
                  "ct0": {
                    "type": "string",
                    "description": "Twitter ct0 cookie value"
                  },
                  "in_reply_to_tweet_id": {
                    "type": "string",
                    "description": "Numeric tweet ID to reply to (optional)"
                  },
                  "quote_tweet_id": {
                    "type": "string",
                    "description": "Numeric tweet ID to quote (optional)"
                  },
                  "medias": {
                    "type": "string",
                    "description": "Comma-separated media IDs from /tweets/mediaUpload to attach (optional), e.g. 2066778128366940160,2066778128366940161"
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getTweetsByIds",
        "summary": "Bulk look up tweets by IDs",
        "description": "Bulk look up multiple Twitter/X tweets by their numeric tweet IDs in a single request. Max 50 IDs.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.01"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": true,
            "description": "Comma-separated numeric tweet IDs, max 50",
            "schema": {
              "type": "string",
              "example": "1110302988,1234567890"
            }
          }
        ]
      }
    },
    "/tweets/long": {
      "post": {
        "operationId": "createLongTweet",
        "summary": "Create a long-form tweet (Note Tweet)",
        "description": "Creates a long-form Post (Note Tweet) for the authenticated user, supporting text beyond 280 characters. Can also reply to or quote a tweet. Requires Twitter/X session credentials.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.0025"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "auth_token",
                  "ct0"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "description": "Tweet content (can exceed 280 characters)"
                  },
                  "auth_token": {
                    "type": "string",
                    "description": "Twitter auth_token cookie value"
                  },
                  "ct0": {
                    "type": "string",
                    "description": "Twitter ct0 cookie value"
                  },
                  "in_reply_to_tweet_id": {
                    "type": "string",
                    "description": "Numeric tweet ID to reply to (optional)"
                  },
                  "quote_tweet_id": {
                    "type": "string",
                    "description": "Numeric tweet ID to quote (optional)"
                  },
                  "medias": {
                    "type": "string",
                    "description": "Comma-separated media IDs from /tweets/mediaUpload to attach (optional)"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tweets/mediaUpload": {
      "post": {
        "operationId": "uploadMedia",
        "summary": "Upload a media file (image)",
        "description": "Uploads an image to Twitter/X for the authenticated user and returns a media_id that can be attached to a subsequent tweet. Send the file as multipart/form-data field \"file\"; pass Twitter/X session credentials as query params.",
        "x-agentcash-auth": {
          "mode": "paid"
        },
        "x-payment-info": {
          "protocols": [
            "x402"
          ],
          "pricingMode": "fixed",
          "price": "0.006"
        },
        "security": [
          {
            "x402": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Bad Request"
          },
          "402": {
            "description": "Payment Required"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "auth_token",
            "in": "query",
            "required": true,
            "description": "Twitter auth_token cookie value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ct0",
            "in": "query",
            "required": true,
            "description": "Twitter ct0 cookie value",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Media file to upload"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}