$0.006
per call · USD Coin on Base
Uploads an image to Twitter/X for the authenticated user and returns a media_id to attach to a tweet. Send the file as multipart/form-data field "file" (e.g. -F "file=@photo.jpeg"); pass auth_token and ct0 as query params. Returns media_id, media_id_string, media_key, size, expires_after_secs, and image metadata.
Endpoint
POST https://x402.twit.sh/tweets/mediaUpload6
Calls / 30d
1
Unique payers / 30d
Sep 2
Last called
exact
Payment scheme
Call this service
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);
const res = await fetchWithPay("https://x402.twit.sh/tweets/mediaUpload", {
method: "POST",
});
const data = await res.json();curl -X POST \
"https://x402.twit.sh/tweets/mediaUpload" \
-H "X-PAYMENT: <signed x402 payment>"Example response
{
"data": {
"expires_after_secs": 86400,
"image": {
"h": 683,
"image_type": "image/jpeg",
"w": 1024
},
"media_id": 2066778128366940200,
"media_id_string": "2066778128366940160",
"media_key": "3_2066778128366940160",
"size": 22610
}
}Payment details
0x9dba414637c611a16bea6f0796bfcbcbdc410df8USD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913Is this your API?
Pin it to the top of Social & Community and the homepage with a featured placement.
More from Twit & similar services
Twit · Tweets Search
x402.twit.sh
Search Twitter/X tweets with advanced filters. Returns up to 20 tweets per page, most recent first, with pagination. At least one filter required. Params: words, phrase, anyWords, noneWords, hashtags, from, to, mentioning, minReplies, minLikes, minReposts, since (YYYY-MM-DD), until, next_token. e.g. GET /tweets/search?words=bitcoin&from=elonmusk&minLikes=100. Returns X v2 API-compatible JSON.
Twit · Tweets User
x402.twit.sh
Get the latest tweets (timeline) from a specific Twitter/X user by their username. Returns up to 20 tweets per page sorted by most recent first, with pagination support. Query params: username (string, required) - Twitter screen name; next_token (string, optional) - pagination cursor, e.g. GET /tweets/user?username=elonmusk. Returns X v2 API-compatible JSON.
Twit · BY ID
x402.twit.sh
Look up a single Twitter/X tweet by its numeric tweet ID. Returns full tweet data including text, author profile, creation date, engagement metrics (likes, retweets, replies, quotes, bookmarks), and referenced tweets. Query param: id (string, required) - numeric tweet ID, e.g. GET /tweets/by/id?id=1110302988. Returns X v2 API-compatible JSON.