{"openapi":"3.1.0","info":{"title":"GB Files Transfer API","version":"1.0.0","description":"Send up to 5 TB directly from your browser or API. No subscription, no install, never restart from zero. One fixed price per transfer, paid once on Stripe Checkout; no API key or account. Uploads are chunked, resumable and SHA-256 verified by storage (send x-amz-checksum-sha256 on each chunk PUT). Downloads support HTTP Range on a stable link."},"externalDocs":{"description":"API guide with curl examples","url":"https://gbfiles.com/docs/api"},"servers":[{"url":"https://gbfiles.com"}],"paths":{"/v1/pricing":{"get":{"summary":"Get transparent pricing tiers and hard limits","responses":{"200":{"description":"Pricing tiers and 5 TB hard limit"}}}},"/v1/health":{"get":{"summary":"Live service and database health check","responses":{"200":{"description":"Healthy"}}}},"/v1/transfers":{"post":{"summary":"Create a pay-first transfer and receive upload token + Stripe checkout URL","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"responses":{"201":{"description":"Transfer initialized in awaiting_payment state"},"400":{"description":"Validation error or exceeds 5 TB limit"},"503":{"description":"Checkout is currently unavailable"}}}},"/v1/transfers/{id}/status":{"get":{"summary":"Get transfer status and missing chunk indices for crash recovery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Upload-Token","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Chunk-level resume ledger"}}}},"/v1/transfers/{id}/files/{fileId}/chunks/{chunkIndex}/presign":{"post":{"summary":"Get a short-lived PUT URL for one chunk. PUT the bytes with header x-amz-checksum-sha256 (base64 SHA-256); mismatches are rejected with 400 BadDigest","responses":{"200":{"description":"Ephemeral presigned PUT URL"},"402":{"description":"Payment required before uploading"}}}},"/v1/transfers/{id}/files/{fileId}/chunks/{chunkIndex}/complete":{"post":{"summary":"Record uploaded chunk ETag and SHA-256 checksum (idempotent)","responses":{"200":{"description":"Chunk checkpoint saved"}}}},"/v1/transfers/{id}/finalize":{"post":{"summary":"Check every chunk has arrived and join them server-side; returns shareUrl","responses":{"200":{"description":"Transfer ready with shareUrl and manifestUrl"},"202":{"description":"Assembling asynchronously via Durable Object alarms"},"409":{"description":"Incomplete upload (missing chunks)"}}}},"/v1/transfers/{id}/manifest.json":{"get":{"summary":"Machine-readable download manifest with file sizes and SHA-256 hashes","responses":{"200":{"description":"Transfer manifest"}}}},"/v1/transfers/{id}/files/{fileId}/download-url":{"post":{"summary":"Get the stable, resumable download link for a file (checks the password for protected transfers)","responses":{"200":{"description":"downloadUrl on this domain, valid until the transfer expires"},"403":{"description":"Wrong or missing password"}}}},"/d/{id}/{fileId}":{"get":{"summary":"Download a file. Supports Range requests; re-run curl -C - to resume. Protected transfers accept ?token= or HTTP Basic auth with the password","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"fileId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Range","in":"header","required":false,"schema":{"type":"string"}},{"name":"token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"File bytes"},"206":{"description":"Partial content for a Range request"},"403":{"description":"Password required"},"410":{"description":"Transfer expired"}}}},"/v1/transfers/{id}":{"delete":{"summary":"Immediately delete every file in the transfer","responses":{"200":{"description":"Transfer purged"}}}}}}