{"uid":"cap_sn-POFi62nEgBDkOlFk9R","slug":"twit-sh-media-upload-c4c97872","name":"twit.sh Media Upload","description":"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.","url":"https://x402.twit.sh/tweets/mediaUpload","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"required":{"type":"string"},"properties":{"type":"string"}}},"responseSchema":{"type":"json","example":{"data":{"size":22610,"image":{"h":683,"w":1024,"image_type":"image/jpeg"},"media_id":2066778128366940200,"media_key":"3_2066778128366940160","media_id_string":"2066778128366940160","expires_after_secs":86400}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.006","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.006/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.006","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_nyA6lSrbETI_W2PlpPRYh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.006","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Uploads a media file (image/video) to X/Twitter via the twit.sh proxy, returning a media_id for use in subsequent tweet posts","exampleAgentPrompt":"Upload this JPEG image to X using twit.sh so I can attach it to a tweet — here's the image data.","exampleUseCases":null,"resultDescription":"Returns a JSON object containing the media_id (numeric and string forms), media_key, image dimensions (width and height in pixels), file size in bytes, image MIME type, and the number of seconds until the uploaded media expires (86400 seconds / 24 hours).","failureModes":["Invalid or missing media file body returns an error","Unsupported media type rejected by X API","Payment failure via x402/USDC prevents request from processing","Media file too large for X's upload limits","Expired or invalid x402 payment header","X API rate limit or service outage causes upstream failure"],"whenToPreferThis":"Use this endpoint when you need to attach an image or media file to a tweet via twit.sh without managing your own X API credentials. It is the right choice when you want pay-per-use media uploads to X without sign-up, using USDC on Base. Prefer it over direct X API access when you don't have or want to manage Twitter OAuth tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T03:45:47.915Z","isFirstParty":false}