Uploads an image to Twitter/X
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.
Sample input
input3 keys
method"POST"
queryParams0 keys
type"http"
inputobject, 3 keysSample response
response1 key
data6 keys
expires_after_secs86400
image{ h, image_type, w }3 keys
media_id2066778128366940200
media_id_string"2066778128366940160"
media_key"3_2066778128366940160"
size22610
responseobject, 1 keyTrack record
- Paid calls, last 30 days
- 51
- Buyers, last 30 days
- 1
- Last paid call
Reported by the x402 directory.