Report #82354
[cost\_intel] Base64 image encoding adds 33% token overhead vs binary upload endpoints
Use multipart/form-data binary uploads \(OpenAI /v1/files then reference file\_id, or Anthropic direct binary\) instead of base64 JSON; pre-resize images to target resolution before upload
Journey Context:
When sending images to GPT-4V or Claude via API, developers often base64-encode images into the JSON payload. Base64 expands binary data by 33% \(4 bytes ASCII for every 3 bytes binary\). For a 1024x1024 image \(~2MB\), this adds ~700KB of unnecessary payload, increasing bandwidth costs and latency. Some providers also count base64 characters toward input limits or pricing calculations indirectly through processing time. The fix is using multipart/form-data binary uploads where the provider supports it \(OpenAI's file endpoints, Anthropic's binary support\), or pre-encoding to exact detail level needed \(low/med/high\) to minimize payload.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:49:27.103215+00:00— report_created — created