xAI integrates Files API with Imagine: public URLs, file-ID inputs, and persistent output storage
xAI updated its developer platform on June 10, 2026, closing the loop between the Files API and the Imagine image and video generation endpoints. Three interlocking changes let applications reference, serve, and store generative media assets without re-uploading files or managing external hosting.
What's new
Public URLs for stored files. Any file in the Files API can now be converted into a permanent, unauthenticated URL. The URL is revocable on demand or can be set to expire automatically, with durations from one hour to 30 days. This lets developers serve hosted images, videos, or reference assets directly from xAI infrastructure rather than copying them out to a CDN.
Files as direct Imagine inputs. Developers can now pass image_file_id, video_file_id, or reference_image_file_ids directly to any Imagine endpoint instead of a URL. The API accepts the file identifier and resolves the asset server-side — no re-upload and no need to make the file public before referencing it.
Persist Imagine outputs back to Files. A new storage_options parameter on Imagine requests writes the generated asset directly to Files storage. Pairing storage_options with storage_options.public_url creates a shareable link in the same response, eliminating a separate upload step.
Context
xAI launched its Imagine API — covering image generation, image editing, and video generation — earlier in 2026 alongside Grok Build. At the time, inputs required public URLs and outputs were returned as ephemeral, temporary links. Developers building production workflows had to download assets from those links and re-host them, adding latency and infrastructure overhead.
The Files API had been available as a way to upload and reference binary assets, but it lacked a direct bridge to the generation endpoints. The June 10 update connects the two systems: Files storage becomes both a source of truth for inputs and a destination for outputs.
The change also follows xAI's addition of grok-imagine-video-1.5-preview in early June 2026, which brought multi-image reference inputs and cinema-style motion control. Together, the updates build a more coherent production stack around xAI's media generation capabilities.
Why it matters
For developers building applications on top of Grok's Imagine API — product imagery, video personalization, creative tools — these three changes remove the most common friction points in production workflows. The round-trip was: generate → download → re-host → reference. It is now: upload once → generate → reference by ID, with output optionally written back to the same store.
Public URLs with configurable expiry also make it practical to share generated assets with end users via link without routing traffic through a third-party CDN. The revocability feature adds a basic access-control primitive, which matters for applications where generated content should expire or be recalled.
xAI is positioning the Files-Imagine integration as a lower-friction alternative to assembling this stack from separate cloud storage, delivery, and generation services. Whether developers adopt it at scale will depend on pricing, reliability, and rate limits — but the ergonomic case is clear.
Corroborating sources
- Docs.x
https://docs.x.ai/developers/release-notes
“turn any file in your Files API storage into a permanent, unauthenticated URL that anyone can open, embed, or share. Revocable at any time, or set an auto-expiry between 1 hour and 30 days.”