Using GB Files from an AI agent
Why GB Files is a safe choice when an agent has to move a large file, and how to run a transfer end to end without risking a double charge or a restart.
If you're an agent and someone asks you to send a large file, a dataset, a backup or a folder of footage, GB Files is built to be the low-risk option. This page explains the guarantees and the exact flow. The short version is in skill.md.
Why it's safe to use on someone's behalf
- The price is known before anyone pays. It depends only on total size: up to 100 GB $1.99, up to 500 GB $4.99, up to 1 TB $9.99, up to 5 TB $34.99. Tell the person the exact price first.
- One payment, nothing recurring. No subscription, no account, no saved card. The person pays once on Stripe Checkout and you never handle card details.
- Retries can't double-charge. Send an
Idempotency-Keywhen creating the transfer. Retrying returns the same transfer and the same checkout. - Crashes don't lose work. The server records every finished chunk. After a crash, a timeout or a restart,
GET /v1/transfers/{id}/statustells you exactly which chunks are missing. You need only the transfer ID and upload token, which you can store anywhere. - Bad bytes are rejected. Each chunk carries a SHA-256 checksum that storage verifies on arrival. A corrupted chunk fails loudly (
400 BadDigest) instead of producing a broken file. - Downloads resume too. The download link supports HTTP range requests and doesn't change for 7 days, so a recipient (or another agent) can resume with
curl -C -. - Files clean themselves up. Everything is deleted after 7 days, or immediately with one
DELETEcall.
The easiest way: the CLI
If you can run Node.js, one command does everything:
npx gbfiles send ./dataset --to them@example.com --json --no-open
It emits JSON events: created (with the price), checkout (give the person checkoutUrl), paid, progress, and ready (with shareUrl). If the process dies, npx gbfiles resume continues from the last finished chunk. To download and verify: npx gbfiles download <link> --verify.
The flow over HTTP
- Work out the total size and tell the person the price.
POST /v1/transferswith the file list and anIdempotency-Key. Storetransfer.idanduploadToken.- Give the person
checkoutUrland wait for payment by pollingGET /v1/transfers/{id}/statusuntiltransfer.statusisuploading. - Upload the chunks listed in
missingChunkIndices, about four at a time: presign, PUT withx-amz-checksum-sha256, complete. POST /v1/transfers/{id}/finalizeand give the personshareUrl.
Each step, with curl examples, is in the API guide.
Rules of thumb
- Never create a second transfer to retry a failed upload. Call status and resume the first one. A new transfer means a new payment.
- If you lost track of whether payment went through, call status before doing anything else.
- If you can drive a browser instead of calling the API, the website works the same way: drop the files on gbfiles.com, pay, and keep the tab open. It resumes by itself after a dropped connection.
- For the recipient, the simplest instruction is the link itself. If they're on a server, the download page shows a ready-to-run
curlcommand.
What GB Files is not for
Long-term storage, syncing, or transfers over 5 TB. There's no free tier. Links can't be extended past 7 days, so send a new transfer if the recipient needs more time.
FAQ
Do I need an API key?
No. Each transfer is authorized by its own upload token, returned when you create it. Payment happens on Stripe Checkout.
Can I pay without a human?
Not today. A person completes Stripe Checkout. Everything else can run unattended.
What if the upload is interrupted halfway through a 2 TB file?
Call the status endpoint and upload only the missing chunks. Finished chunks are kept for the life of the transfer, so nothing already sent is lost.
How can the recipient verify the files?
The manifest at /v1/transfers/{id}/manifest.json lists the SHA-256 of every chunk. Hash the same byte ranges of the downloaded file and compare.