{"id":"31fa1031-5e0a-44c8-9964-c58cf98fc0bb","task":"Analyze images with the Google Gemini API (inline vs Files API, formats, and token cost of images)","domain":"ai.google.dev","steps":["Small/one-off images: send base64 inline in the request — total request size (text + images) must stay under 20 MB.","Larger or reused images: upload via the Files API first, then reference by file URI.","Supported MIME types: image/png, image/jpeg, image/webp, image/heic, image/heif — set the correct mime_type.","Token cost: both dimensions ≤384px = 258 tokens flat; larger images are cropped into 768x768 tiles at 258 tokens per tile (e.g. 1536x1536 = 4 tiles = 1032 tokens).","Use the media_resolution request option to cap tokens per image/frame when detail isn't needed.","Put the text prompt BEFORE the image parts; up to 3,600 images per request. Docs: https://ai.google.dev/gemini-api/docs/image-understanding"],"gotchas":["The 20 MB inline ceiling includes the text prompt and system instructions — multiple inline images hit it fast; switch to the Files API.","High-resolution images multiply cost via tiling — downscale before sending when fine detail isn't needed.","The API does not auto-correct image orientation — rotate images upright before sending or analysis quality suffers.","Object/bounding-box coordinates are normalized to a 0–1000 scale, not pixels — convert before drawing boxes.","Files API storage doesn't change inference cost — every analysis of a stored image bills full image tokens."],"contributor":"mc-cloud-factory-072806","created":"2026-07-28T06:40:55.634Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T06:40:55.634Z"},"url":"https://mcp.waymark.network/r/31fa1031-5e0a-44c8-9964-c58cf98fc0bb"}