Telegram sendPhoto limits: 10 MB, 10000 px, 20:1 ratio
Telegram sendPhoto rejects photos over 10 MB, over 10000 px width plus height, or past 20:1. How to size an AI image with Sume before the bot sends it.

Telegram's Bot API says sendPhoto takes a photo up to 10 MB, with width and height together no larger than 10000 and a width-to-height ratio of at most 20. A caption may run 0-1024 characters. An AI image at ordinary generator sizes clears all three limits by a wide margin, so the practical job is to ask for a sensible aspect ratio and a compact file format, and to check the limits on anything you upscale.
What are the exact sendPhoto limits?
The limits come from the sendPhoto method description in the Bot API reference. They are separate from the 50 MB ceiling the same page gives for sendDocument, sendAudio and sendVideo uploads, which is the route for files that do not fit the photo rules.
| Item | Limit | Where it applies |
|---|---|---|
| Photo file size | 10 MB | sendPhoto |
| Width plus height | 10000 px at most | sendPhoto |
| Width to height ratio | 20 at most | sendPhoto |
| Caption | 0-1024 characters | sendPhoto |
| Other file types | 50 MB | sendDocument, sendAudio, sendVideo |
How do I stay inside the ratio and pixel sum?
The sum rule is easy to break only with very long panoramas or large upscales. A 3840 px edge, the largest custom edge the Sume images doc allows on GPT models, paired with a 3840 px other edge would sum to 7680, under 10000. The ratio rule matters more for banner-style art: Sume's aspect_ratio list tops out at 8:1 and 1:8, so a normalized request cannot exceed Telegram's 20:1.
Pick the aspect ratio for how the picture will read in a chat, then confirm the returned dimensions. Sume returns Sume-hosted URLs with usage data, and the response carries the normalized aspect_ratio it used.
How do I request a compact file from Sume?
Ask for output_format of jpeg when the picture is a photograph or a painterly render, since the images API accepts png, jpeg, webp or svg and JPEG is a lossy format suited to continuous-tone art. Use png only for flat graphics where you need crisp edges. Always check the file size of the result before upload; Sume does not promise a byte size, and Telegram enforces 10 MB at the method.
import json, os, urllib.request
body = {
"model": "bytedance-seed/seedream-4.5",
"prompt": "a ceramic mug on a wooden desk, soft window light",
"aspect_ratio": "4:5",
"output_format": "jpeg"
}
req = urllib.request.Request(
"https://api.sume.com/v1/images",
data=json.dumps(body).encode(),
headers={
"Authorization": "Bearer " + os.environ["SUME_API_KEY"],
"Content-Type": "application/json",
},
method="POST",
)
print(urllib.request.urlopen(req).read().decode())What should the bot do when a photo is rejected?
Treat a rejection as a sizing problem first, not a transient error.
- Re-request the image at a smaller
aspect_ratioextreme or a lower resolution tier instead of retrying the same upload. - Fall back to sendDocument for the original file, which Telegram caps at 50 MB.
- Keep the caption under 1024 characters; longer text goes in a follow-up sendMessage.
- Pass the media as a URL or an uploaded file, as the Bot API sendPhoto parameter describes, and keep the generated file for the retry.
What is still on you?
Sume prepares the pixels; the bot still owns the send. The images guide lists the parameters, and the API reference covers authentication. Check the Bot API page again before a production release, since Telegram changes method fields with each numbered release.
Sources
Related posts
More in Integrations
- Telegram sendVideo cover and start_timestamp: pick a poster frame
sendVideo takes a cover image and a start_timestamp in seconds. Use Sume video-frames to pull candidate stills from a generated clip and choose the poster.
- Telegram sendVoice formats: OGG/Opus, MP3 or M4A up to 50 MB
Telegram sendVoice accepts OGG/Opus, MP3 or M4A up to 50 MB. Pull an MP3 track from a generated video with Sume audio-detach and send it as a voice note.
- TikTok max_video_post_duration_sec: trim before Direct Post
TikTok's creator_info endpoint returns max_video_post_duration_sec, a per-creator limit. Read it first, then cut the clip to fit with Sume video trim.
- TikTok privacy_level_options: public vs private account values
TikTok creator_info returns different privacy_level_options for public and private accounts, and Direct Post privacy_level must match one. Values for each.
Written by Sume