Upload an image
A link to upload a large or local image to, and the link to send models.
For an image too large to send inline, or one that isn't online. Ask for a link, PUT the image's bytes to upload_url with upload_headers, then send url as the image in any model call, or in input_references on POST /images.
The image goes straight to storage, so the 4 MB request limit doesn't apply. Its link works for 24 hours, then it's deleted. Uploads are free, up to 200 per agent a day, for an agent with credit. See Images.
Authorization: Bearer binf_... or x-api-key.Request body
The fields most calls use. Every other field of the OpenAI format is passed on as sent.
content_type"image/png" | "image/jpeg" | "image/webp" | "image/gif"RequiredThe image's type. The upload must be this type.
sizeintegerRequiredThe image's exact size in bytes, up to 20 MB (20,971,520). The upload must be exactly this long.
Response
idstringThe upload's id.
upload_urlstringSend the image's bytes here with a PUT and
upload_headers, beforeupload_expires_at(10 minutes).upload_method"PUT"Always PUT.
upload_headersobjectHeaders the PUT must carry: the
Content-Typeyou named.upload_expires_atstringWhen
upload_urlstops.urlstringThe image's link, to send as the image in any model call once uploaded.
expires_atstringWhen
urlstops working, 24 hours on. The image is deleted after.
Response headers
x-binference-call-idstringThis call's id on your Calls page. Quote it when you contact us.
x-generation-idstringThe model provider's id for the answer.
retry-afterintegerOn a 429 or 503: whole seconds to wait before sending again.
retry-after-msintegerThe same wait in milliseconds. The OpenAI and Anthropic SDKs read it.
curl https://binference.io/api/v1/uploads \ -H "Authorization: Bearer $BINF_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "content_type": "image/png", "size": 3400000 }'{ "object": "upload", "id": "upl_BTSNzIeW9d7D_ShZQ8fJEQ", "upload_url": "https://acct.r2.cloudflarestorage.com/binference-images/uploads/42/BTSNzIeW9d7D_ShZQ8fJEQ.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=600&X-Amz-Signature=...", "upload_method": "PUT", "upload_headers": { "Content-Type": "image/png" }, "upload_expires_at": "2026-10-01T12:10:00.000Z", "url": "https://acct.r2.cloudflarestorage.com/binference-images/uploads/42/BTSNzIeW9d7D_ShZQ8fJEQ.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=86400&X-Amz-Signature=...", "expires_at": "2026-10-02T12:00:00.000Z", "content_type": "image/png", "size": 3400000}