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.

4 min readSume
All posts

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.

Telegram sendPhoto limits (read 2026-10-02)
ItemLimitWhere it applies
Photo file size10 MBsendPhoto
Width plus height10000 px at mostsendPhoto
Width to height ratio20 at mostsendPhoto
Caption0-1024 characterssendPhoto
Other file types50 MBsendDocument, 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_ratio extreme 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

All Integrations posts

Written by Sume