Skip to content
cheapxapi
All endpoints

Post a tweet or reply

POST/twitter/create_tweet_v2

Posts a tweet as the logged-in account. Set reply_to_tweet_id to reply. Attach images or videos with media_ids from Upload media. At most 5 per minute per X account.

Price: $0.0006 per request.

Request body

Send as application/json.

  • login_cookiesstringrequired

    The login_cookies value returned by Log in to an X account. Send the same value with every action for that account.

  • tweet_textstringrequired

    Text of the tweet.

  • reply_to_tweet_idstring

    Numeric ID of the tweet to reply to.

  • attachment_urlstring

    URL of a tweet to quote, or another link to attach.

  • community_idstring

    Numeric ID of a community to post in.

  • is_note_tweetboolean

    Set to true for a long post (more than 280 characters, needs X Premium).

  • media_idsarray of string

    Media IDs returned by Upload media.

  • proxystringrequired

    Proxy for this X account, in the form scheme://user:pass@host:port where scheme is http, https, socks5 or socks4. Use the same proxy for every request of the account. Must be a public address; a residential proxy is recommended.

Example request

curl -X POST "https://api.cheapxapi.com/twitter/create_tweet_v2" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "login_cookies": "<login_cookies>",
    "tweet_text": "<tweet_text>",
    "proxy": "<proxy>"
  }'

Response

Charged. "status": "success" means the action was done; "status": "error" means X rejected it and message says why.

FieldType
tweet_idstring
statusstring
messagestring

Status codes

200
Charged. "status": "success" means the action was done; "status": "error" means X rejected it and message says why.
400
Missing or invalid fields (not charged). The message names the field; your values are never echoed back.
401
Missing or invalid API key (not charged).
402
Insufficient balance (not charged).
405
Wrong HTTP method (not charged).
413
Request body too large (not charged).
429
Rate limit exceeded, including the per-X-account and login limits (not charged). Retry after the time in the Retry-After header.
503
Temporary service problem (not charged). If it says the request timed out, the action may already have been applied on X: check before retrying.