How to Add Images, GIFs and Video to X Posts
To add media to a post, ask your AI to upload it with Kalen. The upload_media tool opens an upload panel in the chat on claude.ai and Claude Desktop; in a terminal or an editor it returns a curl line that uploads a local file. When you’re done, your AI lists your files to get their media ids (they start with m_) and attaches them to the post when it schedules it. You can add alt text to each file for screen readers.
What you can upload
| Type | Max size |
|---|---|
| JPG, PNG, WebP | 5 MB |
| GIF | 15 MB |
| MP4 video | 50 MB |
A post takes up to 4 images, or 1 video or GIF. In a thread, media goes on tweet 1 only. A first reply can’t carry media. You can upload up to 100 files a day.
Steps in Claude
- Send the first prompt below. The upload panel opens in the chat.
- Drop your files on the panel. Each row shows its progress and its new id.
- Tell your AI you’re done. It calls
upload_mediawith action list to get the ids. - It adds alt text if you want, then schedules the post with
media_ids.
Steps in a terminal or editor
- Ask for the upload link. Kalen returns a
curlline. - Run it once per file, changing the path:
curl -F "file=@/path/to/image.png" "<upload link from Kalen>"
- The link is valid for an hour and takes any number of files in that hour.
- Ask your AI to list your media for the ids, then schedule with them.
The prompts
Open Kalen's upload panel. I'm sending two screenshots for tomorrow's post.
List my Kalen media, add alt text to the two newest screenshots describing what they show, and attach them to tomorrow's 9am post.
Example
An illustration, not a real account.
You: Open Kalen’s upload panel, I have a demo video for Thursday’s post.
Your AI calls upload_media. Kalen: the upload panel is open; drop your images or video there and tell me when you’re done. You drop an MP4 and say done. Your AI lists your files, finds the video’s id, shows you the post with the video attached and its time, and schedules it after your yes.
What it costs
Uploading and adding alt text cost no credits. The post that carries the media costs what any post costs: 1 credit, 2 with a first reply or a link.
Common errors
- “unknown media …; upload with upload_media first.” The id is wrong or the file never finished uploading. List your media and use the ids shown.
- The file is refused. Check the type and size limits above. Kalen checks the real type from the file, not its name.
- “a first reply can’t carry media; media goes on the post.” Move the media to the post itself.
- The upload link expired. It lasts an hour. Ask for a new one.
- No panel in your app. Use the
curlline.
Next
Next: Queue and changes.