Upload Media from Base64
upload_media_from_base64Last resort for small files: upload a file sent as a base64-encoded string. Prefer, in order: upload_attached_file for files the user attached in this chat (ChatGPT); create_upload_url + finish_upload if you can run shell commands (curl); open_upload_box to let the user pick files from their device; upload_media_from_url for public links. The file is stored exactly as received, without compression or resizing.
Max size: 7MB. Supports: JPEG, PNG, GIF, WebP, MP4, MOV, PDF. Returns a media ID that can be attached to a post.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Base64-encoded file content (raw base64 or a data URI) | |
| filename | Yes | Filename with extension (e.g. "photo.jpg") | |
| mimeType | Yes | MIME type of the file |