Learning resourcesReviewed · xAI

xAI Public URLs guide

xAI's Public URLs guide helps developers share stored files through public links, with the catch that anyone holding a link can access the file. It covers REST and Python usage, expiry, revocation, and restrictions on file size, formats and active links.

Researched 15 Nov 2026

In short.

xAI's Public URLs guide explains file sharing for developers using the xAI API, with the main catch that each public link allows access without authentication. It documents how to create, expire, inspect and revoke links while keeping the underlying file private through the Files API. Each file can have one active public URL, eligible files are limited to 50 MiB, and each team can have up to 1,000 active URLs. Pricing, licensing and runtime reliability are not established by the page.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage includes the complete selected page at [https://docs.x.ai/developers/files/public-urls.md], including examples, expiry behavior, idempotency, revocation, file-state filters, limitations and integration notices. Linked file-management, image/video integration and REST-reference pages are excluded. No commands or SDK examples were executed. Runtime behavior, performance, pricing, licensing and live service status remain unverified or unknown where the page does not establish them.

The overview

identity

This is xAI's developer guide to Public URLs for Files API storage [https://docs.x.ai/developers/files/public-urls.md]. It teaches a file-sharing feature rather than providing a standalone application, model or downloadable library.

The feature exposes an existing stored file through a CDN link. Creating that link leaves the underlying file in private storage; recipients use the public link without an API key.

assessment

The guide is useful for developers who need shareable images, videos or PDFs already stored with xAI. Its strongest detail is lifecycle control: it explains default expiry, explicit deadlines, repeated creation calls and link replacement after revocation.

It is a suitable approach when access by anyone holding the link is acceptable. For files requiring login checks or individual access permissions, the page recommends serving private content through an authenticated backend. Delivery performance and operational reliability are not assessed.

users

The main audience is developers integrating xAI file storage or sharing generated image and video assets. Beginners receive curl and Python examples, but still need familiarity with API keys, file identifiers and basic API requests.

Experienced developers can use the documented expiry rules, metadata fields and listing filters to manage shared assets. Teams needing different permissions for different recipients would need an access-controlled delivery approach.

capabilities

The API can create a public URL, assign or update its expiry, revoke it, and expose its current state through file retrieval and listing. The public_url and public_url_expires_at fields identify active sharing, while list filters distinguish files with and without public URLs.

The page also describes requesting a public URL while generating an image or video through storage_options.public_url. Detailed instructions for that integration are on a linked page outside this scope.

Using it

requirements

Managing links requires an xAI API key and a file already present in Files API storage. Recipients need no API key to open the resulting public URL. Ordinary file upload and public-URL creation are separate operations.

Files must meet the size and content-type restrictions, and the team must remain within the active-URL limit. The shell quick start uses curl and jq; the Python examples use xai_sdk. Minimum SDK versions and installation instructions are not supplied.

mechanism

Each file can have one active public URL. Repeating creation returns the existing URL; supplying a different expires_after updates its expiry while preserving the token. Explicit expiry must be between 3,600 and 2,592,000 seconds and cannot exceed the file's remaining lifetime.

Without an explicit URL expiry, the link inherits the file's expiration. If the file has no expiration either, the link persists until revocation or file deletion. URL expiry leaves the underlying file available through authenticated access, provided the file itself has not expired.

Revocation invalidates the link for everyone without deleting the file. Repeated revocation is documented as safe, including for deleted files. Creating a link after revocation produces a fresh token; the previous URL remains invalid.

setup

Provide the API key as XAI_API_KEY, upload a file through POST /v1/files or obtain an existing file identifier, then send POST /v1/files/{file_id}/public-url. An empty JSON body uses the default expiry behavior; expires_after requests a specific lifetime.

The Python equivalent initializes xai_sdk.Client, uploads through client.files.upload and calls client.files.create_public_url. Revoke sharing through client.files.revoke_public_url or POST /v1/files/{file_id}/public-url/revoke. The page does not establish a compatible SDK version.

example

For a PNG already uploaded without a file expiry, client.files.create_public_url(file.id, expires_after=86400) requests a link lasting 24 hours. According to the guide, expiry makes subsequent link requests return 404 while leaving the stored file available through authenticated endpoints.

Calling creation again with expires_after=604800 changes that same link to a seven-day lifetime, subject to any file-expiration constraint. To replace a leaked link, revoke it and create another; changing expiry alone preserves the existing token. These are documented examples, not observed results.

Assessment & evidence

limitations

Public files are limited to 50 MiB and the listed content types: PNG, JPEG, GIF, WebP, MP4, WebM and PDF. Larger files remain accessible through authenticated Files API endpoints but cannot receive public URLs.

There can be only one active public URL per file and up to 1,000 per team. An explicit URL lifetime must fall between one hour and 30 days, and a URL cannot outlive its file. Deleting or expiring the file also invalidates its public link.

Revocation affects every recipient of that link. The page supplies no guarantees about previously downloaded copies, caching behavior, delivery latency or availability.

reasoning

The practical decision is whether possession of a link is sufficient authorization for the intended audience. If it is, the documented API offers sharing without requiring recipients to authenticate.

Expiry deserves an explicit choice: omitting it on a file without expiration creates an indefinitely active link. Repeated creation also preserves the token, so it cannot serve as link rotation. Revocation followed by creation is the documented way to replace a compromised link.

alternatives

For access limited to logged-in users, the page recommends keeping the file private and retrieving it through GET /v1/files/{file_id}/content in your own backend. Your application would control who receives that content.

For newly generated images or videos, storage_options.public_url offers creation within the generation request. This is another route to the same public-sharing feature; its detailed integration is outside the selected page. Comparisons with other storage services are not established.

evidence

The evidence is the complete xAI Public URLs documentation page [https://docs.x.ai/developers/files/public-urls.md]. It contains REST and Python examples, lifecycle rules, metadata filters, integration notices and explicit restrictions.

The described behavior comes from documentation rather than execution. No API calls or SDK examples were run, and there are no measured results for performance, reliability or revocation timing.

Access & freshness

costs

Cost is unknown. The page gives no prices for uploading, storing or serving files, creating public URLs, or generating associated images and videos. It does not establish whether CDN delivery adds charges.

The limit of 1,000 active public URLs per team is a capacity restriction, not evidence of a free allowance.

rights

The page states no license for its documentation or code examples and provides no terms establishing redistribution rights for uploaded files or generated assets. Those permissions remain unknown.

A public URL establishes technical accessibility. The page does not establish that making a file accessible grants recipients permission to reuse it.

freshness

The documentation snapshot was captured on 15 November 2026 at 10:50:38.957 UTC. The page gives no publication date, last-updated date or minimum SDK version.

The snapshot establishes what the documentation stated at capture time. Current live behavior and subsequent documentation changes are not verified.

actions

Confirm that the file's format and size qualify, decide whether unrestricted link access suits its audience, and choose an expiry consistent with the file's remaining lifetime. Retain the file identifier so sharing can be inspected or revoked.

Before depending on the feature, establish current pricing, applicable content rights and SDK compatibility. Validate expiry, revocation and link replacement in your own integration. For login-controlled delivery, follow the private-file backend approach described on the page.

Evidence for this report

selected-page.txtselected · checked 2026-11-15