Turn images into public CDN URLs for AI, OCR, and social workflows
Generated images, screenshots, decoded Base64 sources, and app attachments often fail as private or redirecting links. Upload the image bytes and pass the returned CDN URL, `content_type`, `file_id`, and `expires_at` into the next API.
- Reviewed by
- GetFileURL technical team
- Updated
- Accepted
- png, jpg, webp, gif, screenshots, generated images
- Response
- url, file_id, content_type, size, expires_at
- Headers
- 200 OK with image/png, image/jpeg, or image/webp
- Use in
- vision APIs, social posts, OCR, CMS imports
What this page answers
It can return public image URLs, but the focus is automation handoff rather than galleries, transformations, or media asset management.
- Reviewed by
- GetFileURL technical team
- Last updated
One request in, a URL and JSON out
curl -X POST https://api.getfileurl.com/v1/files \
-H 'Authorization: Bearer $GETFILEURL_KEY' \
-F 'file=@image.png' \
-F 'visibility=public'{
"url": "https://cdn.getfileurl.com/f/file_8ks41p/image.png",
"file_id": "file_8ks41p",
"content_type": "image/png",
"expires_at": "2026-06-26T10:30:00.000Z"
}Image APIs usually need a raw, reachable image URL.
Generated images and app attachments often live behind temporary links. GetFileURL makes the image reachable for the next automation step with a URL that returns image bytes.
AI image workflows
Host generated images long enough to pass the returned URL into moderation, vision, OCR, editing, or publishing APIs.
Social publishing
Give social tools a direct image URL instead of a Google Drive or app attachment page.
Screenshots and support
Attach screenshots to ticket enrichment, OCR, CRM, or internal review workflows.
Upload an image file, or decode a Base64 source before upload.
Use multipart upload when you have image bytes. If an AI tool, webhook, or app API only gives you an encoded string, decode it into a Blob, File, or server buffer first, then upload it as the multipart `file` field.
Multipart image
Send `file=@image.png` when your app, worker, or automation step can attach the actual file.
Base64 image source
Decode the Base64 string, preserve `filename` and `content_type`, then upload the decoded bytes with the same upload API.
Recipe
Use the Base64 image recipe when the source payload is JSON but the final GetFileURL request should still be multipart.
Preserve image metadata where downstream tools care.
The goal is a URL that behaves like an image file: correct content type, predictable size, no redirect page, and a JSON response your workflow can map.
content_type
Keep `image/png`, `image/jpeg`, or `image/webp` visible in the response and delivery headers.
expires_at
Use shorter retention for one-time AI jobs and longer retention for published assets.
file_id
Use the returned file ID to remove images that only existed for a temporary workflow.
Check that the URL returns image bytes, not a preview page.
Before sending an image URL to OCR, AI vision, social, or CMS APIs, verify the public URL returns a successful image response.
Status
`curl -I <returned-url>` should return `200 OK` without a sign-in page or redirect chain.
Content type
The response should show an image MIME type such as `Content-Type: image/png`.
Source links
If a Drive or app link returns HTML, upload the image and pass the GetFileURL URL instead.
Use the returned image URL where the next API asks for an image URL.
Vision and OCR APIs commonly accept either an uploaded file, a public image URL, or provider-specific Base64 input. GetFileURL is the URL handoff layer: it makes the image reachable and keeps cleanup metadata beside the job.
Vision APIs
Pass the returned `url` into image analysis or moderation calls that accept public image URLs.
OCR APIs
Use the returned image URL for OCR tools that fetch the image server-side, then keep `file_id` for cleanup.
Base64 sources
When the source gives Base64 but the destination wants a URL, decode first, upload the bytes, and map the returned URL.
Fix image links that look public but fail server-side.
Many image problems come from preview pages, permissioned app links, expired attachments, or mismatched image headers.
Drive and app redirects
If the URL returns HTML before image bytes, upload the image and use the returned CDN URL.
Wrong format header
Check that the public URL delivers `image/png`, `image/jpeg`, or another accepted image content type.
Publishing failures
For social or CMS workflows, keep the image reachable until the destination platform has fetched it.
Copy the same upload shape into code
curl -X POST https://api.getfileurl.com/v1/files \
-H 'Authorization: Bearer $GETFILEURL_KEY' \
-F 'file=@image.png' \
-F 'visibility=public'Common questions
Is this an image hosting product?
It can return public image URLs, but the focus is automation handoff rather than galleries, transformations, or media asset management.
Why not use a Google Drive image link?
Drive links often return sharing pages, redirects, or permission behavior. Many APIs need the image bytes at the URL directly.
Can I use this for AI-generated images?
Yes. Upload the generated image file, or decode a Base64 image source and upload the bytes, then pass the returned CDN URL into the next vision, editing, or publishing step.