Get started

Quickstart

From nothing to a file served by the CDN, with the API only — no SDK, any language. Five steps, about five minutes.

01

Create your account

Create your account with Google. There is no form to fill in and no card to give: the dashboard opens as soon as you are in.

02

Add credit

XFiles is prepaid: what you use is drawn from your balance by the day, and there is no subscription. In the dashboard, open Billing and add credit — from $5. Uploads need a balance above zero, and the platform (search, live updates, chat, notifications, multiplayer, email) starts working once the account has had credit.

Costs: Every price is on the pricing page. A low-balance email warns you before you run out, and nothing stored is deleted at zero.

03

Make a project

A project is a wall around one app's data: its own files, collections, channels and mailboxes. In the dashboard, open the project menu at the top of the sidebar and choose New project. Its API key is shown once — copy it now, and keep it on your server.

.env
1XFILES_KEY=xf_AbC12dEfGhIjKlMnOpQrStUvWxYz9012

Keep it secret: The key acts as the project. Never put it in a browser or an app: browsers get short-lived tokens instead (see API keys & tokens). Lost or leaked? Rotate it under Keys & access.

04

Upload a file

Uploads take three calls, and the file never passes through your server: ask for an upload URL, send the bytes straight to storage, then confirm.

1 · ask for an upload URL
1printf 'Hello, world' > hello.txt
2
3curl -X POST https://www.xfiles.dev/api/v1/files/upload-intent \
4 -H "Authorization: Bearer $XFILES_KEY" \
5 -H "Content-Type: application/json" \
6 -d '{ "filename": "hello.txt", "contentType": "text/plain", "size": 12, "visibility": "public" }'
Response
1{ "fileId": "abc123def456", "uploadUrl": "https://…amazonaws.com/…?X-Amz-Signature=…", "expiresIn": 900 }
2 · send the bytes to storage
1curl -X PUT "$UPLOAD_URL" -H "Content-Type: text/plain" --data-binary @hello.txt
3 · confirm
1curl -X POST https://www.xfiles.dev/api/v1/files/confirm \
2 -H "Authorization: Bearer $XFILES_KEY" \
3 -H "Content-Type: application/json" \
4 -d '{ "fileId": "abc123def456" }'

Locked in: The upload URL fixes the type and size you declared: storage refuses anything else, so a browser handed the URL cannot swap the file.

05

Serve it

Every file comes back with its CDN url. A public one lasts for good; a private one is signed for five minutes.

GET /api/v1/files/{id}
1curl https://www.xfiles.dev/api/v1/files/abc123def456 -H "Authorization: Bearer $XFILES_KEY"
Response
1{
2 "file": { "id": "abc123def456", "originalFilename": "hello.txt", "visibility": "public", … },
3 "url": "https://<your CDN>/files/originals/public/…/hello-k9x2m7.txt"
4}

Images can carry seven WebP widths for responsive pages: add "transformations": { "image": { "enabled": true } } to the upload intent, and the answer lists a url for each width.

06

Next steps

API keys & tokensOrganization keys for many projects, and tokens for browsers.
Files APIAttach files to your objects, list them back, private links, variants, bundles.
Platform guideSearch, live updates, chat, notifications and multiplayer.
EmailMailboxes on your own domain.
MCP serverLet your AI agent do all of the above.

Building with an AI assistant?

Point it at the complete reference, or connect the MCP server so it can read these docs and use your project.