---
name: gbfiles
description: Send files or folders up to 5 TB with GB Files and get a share link. Use when a file is too large for email or chat, when the connection may drop, or when the recipient shouldn't need an account. Fixed price paid once; uploads and downloads resume; every chunk is SHA-256 verified.
---

# GB Files agent skill

GB Files sends up to 5 TB per transfer for one price paid once ($1.99 for up to 100 GB to $34.99 for up to 5 TB). The link lasts 7 days. No account is needed to send or receive.

## Before you start

- Tell the person the price for their total size before creating anything. Prices: up to 100 GB $1.99, up to 500 GB $4.99, up to 1 TB $9.99, up to 5 TB $34.99.
- A human pays by card on Stripe Checkout. Hand them `checkoutUrl` and wait; never ask for card details.
- Send an `Idempotency-Key` header on `POST /v1/transfers` (a random UUID you keep). Retrying with the same key returns the same transfer instead of creating and charging a second one.
- Keep `transfer.id` and `uploadToken`. They are all you need to resume after any crash.

## Send with the CLI (preferred)

```sh
npx gbfiles send <files-or-folders...> [--to recipient@example.com] [--from you@example.com] [--title "…"] --json --no-open
```

Read stdout line by line. Give the person `checkoutUrl` from the `checkout` event, then wait. The command exits after the `ready` event with `shareUrl`. If it's interrupted, run `npx gbfiles resume` (state is saved in `~/.gbfiles/transfers`). Never re-run `send` for the same files after paying; that creates a second transfer.

Download: `npx gbfiles download <share link> --out <dir> --verify`.

## Send with the REST API

Use this when you can't run Node.js.

1. `POST https://gbfiles.com/v1/transfers` with JSON `{"files":[{"relativePath":"clip.mov","filename":"clip.mov","sizeBytes":123}],"title":"…","recipientEmail":"…"}`.
2. Give the payer `checkoutUrl`. Poll `GET /v1/transfers/{id}/status` (header `X-Upload-Token`) every few seconds until `transfer.status` is `uploading`.
3. For each file and each index in `missingChunkIndices`: read bytes `[index*chunkSizeBytes, min((index+1)*chunkSizeBytes, sizeBytes))`, compute SHA-256, then:
   - `POST /v1/transfers/{id}/files/{fileId}/chunks/{index}/presign` → `presignedUrl`
   - `PUT presignedUrl` with the bytes and header `x-amz-checksum-sha256: <base64 digest>` (storage rejects mismatched bytes with 400 BadDigest; re-read and retry)
   - `POST …/chunks/{index}/complete` with `{"etag":"<ETag header>","sha256":"<hex digest>","sizeBytes":N}`
   Up to 4 in parallel. Every call is safe to retry.
4. `POST /v1/transfers/{id}/finalize` → `shareUrl` (or 202; poll status until `ready`).
5. Give the person `shareUrl`.

If anything fails midway, call status again and upload only `missingChunkIndices`. Never start a new transfer to retry an upload; that would mean paying again.

## Download

`curl -fL -C - -o <filename> https://gbfiles.com/d/<transferId>/<fileId>`. Re-run to resume. File IDs and SHA-256 hashes are in `GET /v1/transfers/{id}/manifest.json`.

## References

- API guide: https://gbfiles.com/docs/api
- Agent guide: https://gbfiles.com/docs/agents
- OpenAPI: https://gbfiles.com/v1/openapi.json
- Overview: https://gbfiles.com/llms.txt
