Skip to content

Latest commit

 

History

History
505 lines (425 loc) · 39.4 KB

api.md

File metadata and controls

505 lines (425 loc) · 39.4 KB

API

Public developer routes use Authorization: Bearer <token>. That is a personal token from uploads login or /account/developers: upk_… from newer CLIs, or the older up_<workspace>_…. The workspace is always in the URL path. A personal token works in the workspace it was minted for and in every other workspace its account is a member of; membership is checked on each request, and a non-member gets 403 workspace_access_denied. One exception: someone who can write to a GitHub repo (write, maintain or admin, through a linked GitHub account) may upload for that repo in the workspace it's linked to without being a member. That covers keys under the repo's gh/ prefixes, github/comment, promote, branch-rename, private-prefix, repo-link, and galleries by reference for the repo, with files:read and files:write only. POST /v1/tokens defaults to 90 days; ttlSeconds: null mints a token that does not expire, and tokenFormat: "upk" mints the upk_… form. Tokens carry named scopes files:read, files:write, and files:delete. The OpenAPI document lists the required scope on each operation. REST v1 does not accept OAuth access tokens.

The canonical resource hierarchy is /v1/workspaces/:workspace/…. These routes also accept a signed-in uploads.sh session when the caller uses the web application. API integrations should use a workspace token.

Unknown workspaces and bad tokens are indistinguishable (both 401).

Service tokens

A service token is a workspace token that belongs to the workspace, not to a member (issue #1026). Use one for CI jobs and bots. It starts with ups_<workspace>_…, so it is easy to tell apart from a personal token. It only works in its own workspace. It has the same file scopes as a personal token, with three differences:

  • Uploads tagged with gh.* metadata are attributed to the token's label: gh.uploader is the label and gh.uploader-kind is service. There is no gh.uploader-id.
  • Removing, demoting, or deleting a member never revokes it. Only a workspace admin revoking it, or its expiry, ends it. The API records which admin minted it, for audit only.
  • It has no GitHub identity, so it cannot claim a repo that is not yet linked to the workspace. Link the repo once with a personal token (uploads github link), then the service token can post to it.

Workspace admins and owners manage service tokens with a signed-in session. Bearer tokens get 403 members_requires_session:

Method Path Notes
GET /v1/workspaces/:workspace/service-tokens Active tokens, newest first. Never returns token values.
POST /v1/workspaces/:workspace/service-tokens Body { label, scopes?, ttlSeconds? }. label is 1–64 characters and unique among active service tokens. scopes defaults to files:read + files:write. ttlSeconds defaults to 90 days; null never expires. Returns the token once.
DELETE /v1/workspaces/:workspace/service-tokens/:id Revokes one service token. It cannot revoke a personal token.

A workspace can have 25 active service tokens. Minting past that, or reusing an active label, returns 409 (service_token_limit_reached, service_token_label_taken).

Idempotency

POST /v1/workspaces/:workspace/galleries accepts an optional Idempotency-Key header. POST /v1/:workspace/galleries accepts the same header and shares the same logical operation.

Use 1 to 255 visible ASCII characters. The API scopes the key to the workspace and the current credential. It retains a successful response for 24 hours. The same key and effective JSON body replay the original 201 response with Idempotency-Replayed: true. The same key with a different effective body returns 409 idempotency_key_reused. A concurrent request can return 409 idempotency_request_in_progress with Retry-After: 1.

The JavaScript client generates a key for createGallery. Pass idempotencyKey in the options when separate client calls must share a key. After 24 hours, the same key starts a new operation.

POST /v1/tokens (workspace token minting) accepts the same header. A token is shown only once, so a retried mint would otherwise either create a second token or lose the only plaintext copy. With an Idempotency-Key, an identical retry replays the original 201 — including the original one-time token — and mints exactly one token; a changed request returns 409 idempotency_key_reused. The replay body is encrypted at rest, so minting requires the server's encryption key to be configured and fails closed (503) otherwise. Authorization is re-checked on every attempt: a caller who has lost workspace access cannot recover a token by replaying a key. The client's mintWorkspaceToken accepts an optional idempotencyKey.

PUT /v1/workspaces/:workspace/files/:key (object upload) accepts the same header. The API scopes the key to the uploaded content and the rest of the request. An identical retry replays the original 201. That avoids both a duplicate object and the 409 key_exists a naive retry would hit on a strict key. A retry with the same key but a different request returns 409 idempotency_key_reused. A concurrent request can return 409 idempotency_request_in_progress with Retry-After: 1. The client's put accepts an optional idempotencyKey. Unlike createGallery, it is never generated automatically — only supplied when the caller opts in.

Errors

Every non-2xx response uses one nested envelope (same shape as either/releases):

{
  "error": {
    "code": "storage_quota_exceeded",
    "type": "insufficient_storage",
    "message": "Storage full: <workspace> is out of space, so this upload didn't go through. Delete files you no longer need, upgrade your plan, or connect your own bucket: <billing> / <storage>",
    "details": { "maxStorageBytes": 1000 }
  }
}
Field Role
type Coarse category; pins HTTP status (validation → 400, not_found → 404, …)
code Stable machine string clients branch on
message Human-readable; may change; never parse this
details Optional structured context for select codes

type is the broad category — validation, not_found, conflict, and so on. Every response of a given type uses the same default HTTP status. Branch client logic on code, not type or status. Many code values share one type. Each still names one specific failure: key_exists, idempotency_key_reused, and key_prefix_not_allowed are all validation or conflict, each with its own distinct code.

An individual AppError can override its default HTTP status. That override applies only to the response actually sent. It never travels on the wire, so a client decoding the envelope always recomputes status from type. No route in this API overrides status today. The mechanism exists in packages/errors/src/base.ts for a case that needs it later.

Throw AppError subclasses from @uploads/errors in route code; the API's onError serializes them. See packages/errors.

Canonical routes

These routes, and /.well-known/openapi.json, are the public API: the contract an SDK is built from. Other routes the web app and CLI call (workspace settings, members, storage setup, service tokens, and the CLI's GitHub plumbing under github/) are internal and can change without notice. apps/api/src/openapi-contract.test.ts makes every new route pick a side.

Route Description
POST /v1/abuse Public content report (no auth). D1 row + email to abuse@uploads.sh. Rate-limited; ABUSE_DISABLED kill switch
PUT /v1/workspaces/:workspace/files/:key Upload a raw body. The API sniffs its type. A normal upload returns 201; ?dryRun=1 returns 200 without writing. Bare keys become f/<id>/<name>. Strict keys require ?replace=1 or X-Uploads-Replace: 1 to overwrite
POST /v1/workspaces/:workspace/files/sign Create a presigned upload. The workspace needs HTTP S3 credentials. The strict-overwrite check happens when the API creates the signed URL, so it is a best-effort guard rather than an atomic guarantee
GET /v1/workspaces/:workspace/files?prefix=&delimiter=&limit=&cursor= List objects with opaque cursor pagination. Response: { files, prefixes, cursor }
GET /v1/workspaces/:workspace/files/search?meta.<key>=<value>&name= Search by metadata equality and/or a filename substring. The response reports truncated and an opaque cursor; pass it back as ?cursor= for the next page
GET /v1/workspaces/:workspace/files/facets?key= List queryable metadata keys or the values for one key
GET /v1/workspaces/:workspace/files/:key Read object metadata. ?metadata=1 returns only the queryable metadata map
PATCH /v1/workspaces/:workspace/files/:key Merge queryable metadata with { set?, delete? }
DELETE /v1/workspaces/:workspace/files/:key Delete an object. Returns 200 { key, deleted: true }
GET /v1/workspaces/:workspace/files/by-path?merged= Group recently uploaded gh.*-tagged files by project and path. Powers the web Screenshots page
GET /v1/workspaces/:workspace/files/file-url?key= Resolve a usable URL for a key: the workspace's public URL, else a short-lived signed URL, else an error
PATCH /v1/workspaces/:workspace/files/visibility?key= Set a file's visibility flag with { visibility: "public" | "private" }
POST /v1/workspaces/:workspace/files/approve?key= Release a file held for review (a likely secret or personal data). A key that is not held returns approved: false
POST /v1/workspaces/:workspace/files/hold?key= Hold an approved file for review again, for an approval made by mistake. Any other key returns held: false
GET /v1/workspaces/:workspace/files/review?key= A file's review state for members: hold (pending, approved or null), reason, and who approved it and when
GET /v1/workspaces/:workspace/files/held?prefix= List files held for review, with the reason
GET /v1/workspaces/:workspace/files/held/download?key= Download a held file for review. Streams the public object of a hosted hold
GET /v1/workspaces/:workspace/usage Read workspace usage, limits, token scopes, and plan; requires files:read
POST /v1/workspaces/:workspace/usage/reconcile Maintenance operation. Potentially expensive: scans storage and rebuilds bytes and objects; bearer token only; requires files:write
POST /v1/workspaces/:workspace/usage/purge-expired Destructive maintenance operation. Permanently deletes objects older than retentionDays, then reconciles; bearer token only; requires files:delete
POST /v1/workspaces/:workspace/galleries Create an empty public gallery; requires files:write; accepts Idempotency-Key for safe retries
GET /v1/workspaces/:workspace/galleries?limit=&cursor= List enriched gallery summaries with opaque cursor pagination; requires files:read
GET /v1/workspaces/:workspace/galleries/:id Read one owned gallery; requires files:read
PATCH/DELETE /v1/workspaces/:workspace/galleries/:id Update or soft-delete gallery metadata; requires files:write
POST /v1/workspaces/:workspace/galleries/:id/items Add one existing, publicly served workspace object; requires files:write
PUT /v1/workspaces/:workspace/galleries/:id/items/order Replace the complete item order; requires files:write
DELETE /v1/workspaces/:workspace/galleries/:id/items/:item Remove a gallery membership without deleting its object; requires files:write
GET /v1/workspaces/:workspace/galleries/by-reference Find linked gallery summaries by provider and coordinate; requires files:read
GET/POST /v1/workspaces/:workspace/galleries/:id/external-references List or link external coordinates; writes require files:write
DELETE /v1/workspaces/:workspace/galleries/:id/external-references/:reference Unlink an external coordinate; requires files:write
GET /public/galleries/:id Read one public gallery by its opaque ID (no auth)
GET /public/galleries/:id/items/:item/download Download one public gallery item as an attachment (no auth). Missing, private or held items return 404
POST /v1/workspaces/:workspace/feeds Create or reuse a public change feed for a repo, optionally scoped to one PR/issue ({ repo, path?, number?, kind? } or pr/issue aliases); requires files:write
GET /v1/workspaces/:workspace/feeds?limit=&cursor= List feed summaries with opaque cursor pagination; requires files:read
GET /v1/workspaces/:workspace/feeds/:id Read one owned feed and its current newest-first screenshots (each item includes pageUrl at /c/<id>/<item>); requires files:read
DELETE /v1/workspaces/:workspace/feeds/:id Soft-delete a feed record; requires files:write
GET /public/feeds/:id Read one public change feed by its opaque ID (no auth). Items are resolved at view time
GET /public/feeds/:id/items/:item Read one public feed item with its neighbours, for paging (no auth)
GET /public/files/:workspace/:key Read one public file's details (no auth). Private and held files return 404; ?download=1 streams the bytes
GET /v1/workspaces/:workspace/pulls?repo=&state=&since=&limit=&cursor= List pull requests with media, newest first. Only the last 90 days unless all=1 or since; requires files:read
GET /v1/workspaces/:workspace/repos?since=&limit=&cursor= List repos with GitHub-tagged media; thumbnails=0 returns names only; requires files:read
GET /v1/workspaces/:workspace/scope/:owner/:repo/files?number= List files for a repo, or one PR or issue with number, newest first; requires files:read
POST /v1/workspaces/:workspace/github/comment Create or update the managed uploads.sh comment on a PR or issue ({ repo, num, kind }). Integration problems return posted: false with a reason, never 5xx; bearer token with files:write

Pagination

Paged collections take ?cursor= and return a cursor field. The field holds an opaque string when another page exists. It holds null when the caller has reached the end.

cursor is the one continuation-field name for v1. Existing fields keep their names. New paged endpoints use cursor rather than a second spelling.

Never parse, construct, or edit a cursor. Each one is scoped to the exact query that produced it. Send it back with that same query, unchanged. A cursor replayed against a different query is rejected with a 400. On file search that error carries the code file_search_invalid_cursor.

File search also keeps its pre-existing truncated flag. The flag reports the same thing from the other direction. truncated: true and a non-null cursor always travel together.

Collection envelope shapes

Every list endpoint below is a stable v1 contract: existing fields keep their names and types, and any new field is additive. cursor/nextCursor behave as described above in every row.

Endpoint Envelope
GET …/files { files, prefixes, cursor }
GET …/files/search { items, truncated, cursor }
GET …/files/facets (no key) { keys, truncated }
GET …/files/facets?key= { key, values, truncated }
GET …/galleries { galleries, nextCursor }
GET …/galleries/by-reference { galleries, nextCursor }
GET …/galleries/:id/external-references { references } (no pagination; the set is small per gallery)
GET …/feeds { feeds, nextCursor }

nextCursor on the gallery endpoints predates the cursor convention below and keeps its name — see "Existing fields keep their names."

Compatibility routes

The bearer-only /v1/:workspace/files, /v1/:workspace/usage, /v1/:workspace/galleries, and /v1/:workspace/feeds route families remain available. They preserve existing response shapes for installed clients. New integrations should use the canonical /v1/workspaces/:workspace/… hierarchy.

The canonical and compatibility routes share mutation handlers where their contracts match. Some list envelopes intentionally differ. In particular, the canonical file list returns { files, prefixes, cursor }, while the compatibility list returns { items, cursor }. The canonical gallery list also adds itemCount, references, and previewUrl to each summary.

url in responses is the durable public CDN URL when the workspace has a publicBaseUrl, otherwise null. File put/list/head, presign, and gallery item payloads also include embedUrl: the same object on the embed host when dual-host policy applies (default for storage.uploads.sh / store.uploads.sh), else null. Prefer embedUrl in GitHub markdown so in-place overwrites revalidate through Camo; keep url for durable links. Successful PUT …/files/:key also returns replaced (true when an object already lived at that key). PUT …?dryRun=1 returns the same fields without writing — replaced: true means a real put would overwrite, and wouldRefuse: true means a real put would instead be refused (see below).

Overwrite semantics (issue #174): gh/-prefixed keys (the managed attach/--pr/--issue layout) always overwrite in place with no confirmation gate — that hot-swap is intentional so PR/issue embed URLs stay stable. Every other key is strict: a PUT to an existing non-gh/ key throws 409 Conflict with code: "key_exists" and details: { key, url, embedUrl } naming the existing object, unless the caller opts in with ?replace=1 (or the X-Uploads-Replace: 1 header). putObject (apps/api/src/files-core.ts) enforces this — it is the one code path shared by the REST route and the MCP worker, so both surfaces get the same contract without a duplicated check. There is no server-side global escape hatch; UPLOADS_OVERWRITE=1 is a CLI-side default (see cli.md) that just sends replace=1 on the caller's behalf. Worker override: optional EMBED_PUBLIC_BASE_URL (empty disables; any URL is a self-hosted embed base). See ops.md.

Galleries

Gallery IDs are opaque gal_… identifiers and do not encode a workspace or GitHub coordinate. Owner responses use camelCase and include the workspace; the unauthenticated public response uses an explicit allowlist and never emits workspace ownership or object keys. Public items contain only id, filename, position, caption, altText, status, url, embedUrl, and contentType. Missing stored objects remain ordered tombstones with status: "missing" and url: null / embedUrl: null.

The owner collection route returns metadata summaries without items; it does not probe object storage. Fetch an individual gallery to hydrate current item status, content type, size, and computed public URL.

All gallery mutations after creation require a positive expectedVersion in the JSON body. A stale version returns HTTP 409 with the current version in error.details. Adding an already-present object is idempotent (HTTP 200); a new membership returns HTTP 201. Adding checks the context-derived workspace's storage and rejects missing objects or objects without a public URL.

This first API slice deliberately excludes item metadata PATCH, batch add, and upload-and-add convenience endpoints.

External-reference inputs currently support only { "provider": "github", "coordinate": "owner/repo#123" }. The server normalizes casing and derives the locator, normalized identity, and fixed GitHub issues URL; clients cannot submit those derived fields. Reverse lookup is authenticated, tenant-scoped, cursor-paginated, and returns gallery summaries without probing storage. References are deliberately not included in the public gallery response yet.

Object provenance metadata

Optional operational labels stored as R2 custom metadata (not EXIF, not on the public CDN response body). Clients may send:

X-Uploads-Meta-client: uploads-cli
X-Uploads-Meta-client-version: 0.4.0
X-Uploads-Meta-source-name: shot.png
X-Uploads-Meta-optimized: 1
X-Uploads-Meta-frame: phone
X-Uploads-Meta-keep-exif: 1

Client allowlist (others dropped): client, client-version, source-name, optimized, frame, keep-exif. Values are printable ASCII, max 128 chars. Never send tokens, workspace secrets, or PII.

Server-only: every API put stores the SHA-256 of the final stored body in file_content_hash. When that hash is known before the write, the same put also stores it on the object as content-sha256. A streamed body is hashed as it is written, so its digest stays in file_content_hash only. Client-supplied content-sha256 headers are ignored. Hold fan-out reads file_content_hash. A presigned upload (POST …/files/sign) does not record a hash. The API does not see those bytes.

Put and head include content-sha256 in provenance when the object carries that stamp. The CLI/uploads mcp set the client fields automatically from optimize/frame options.

Two bags, two names. provenance is this R2 bag. metadata always means the queryable tier described below — on put, on ?metadata=1, on PATCH, and on a ?metadata=1 listing. Before this split, put and head called the provenance bag metadata, which no client could tell apart from the queryable tags. Read provenance for the upload's own labels and metadata for the tags you set.

A put response reports metadata only when that put wrote tags: a put with no X-Uploads-Meta-* header of its own leaves any existing tags untouched, so the server omits the field rather than implying an empty set. The reported set includes server-derived pairs the client never sent, such as gh.uploader. A plain head returns no metadata at all — the queryable tier is a separate store, so it takes a separate read (?metadata=1).

Experimental AI labels. When Flagship llm-file-classifier serves on for the workspace slug (org / workspace targeting context), a successful server-mediated put may later write server-owned ai.kind, ai.surface, ai.screen, and ai.classifier (v5 for original bytes, v6 when the image was resized for Jev, skipped when the model does not see an image). ai.skip is small, unsupported, resize_failed, or resize_timeout. A skip writes no kind, surface, screen, or safety value. A call that times out, errors, or returns no confident answer writes ai.classifier=failed and ai.error (timeout, provider_error, or no_answer), unless identical bytes already have an earlier result. The same call, when it does run, also writes internal ai.rating, ai.content, ai.secret, and ai.pii, each with an ai.<flag>.confidence of high (0.85+), medium (0.70 up to 0.85), or low (0.50 up to 0.70). Those flags do not bump the classifier version. v4, v5, v6, and skipped still name the pixel path. A low-confidence enum is omitted, and so is its confidence key. A stored safety flag stays until a later classification writes that key, including a confident none. A miss leaves the previous value. A skip does not write one. Re-uploading identical bytes does not clear a flag. The same content hash on another key reuses the flags with no model call. An equal perceptual hash reuses the display labels and writes the flags from a safety-question call on the new bytes. New bytes clear every ai.* row before classification runs, so labels from the old bytes never remain. The labeler does not write ai.tags or ai.summary (older rows may still have them). A Luna Decisions try writes ai.classifier=v4 and the same enums. Luna does not receive the resized copy. A file Luna cannot see is unsupported. A trivially small image is skipped before either provider runs. Clients cannot set or delete those keys (ai.* is reserved, same as video.* / image.*). Public file, gallery, feed, embed, and pull-request responses omit every ai.* key. Workspace members can still read and search them. The 201 response does not wait for the model; read GET …/files/:key?metadata=1 (or uploads meta get <key>) after the upload. Presigned uploads never get labels. See docs/ops.md.

A high-confidence ai.secret (not none), or a high-confidence ai.pii of identity_document or financial, holds the file: the server writes ai.hold=pending. Only an upload whose User-Agent is the uploads CLI (or its local MCP) at 0.59.0 or newer is held, since older clients cannot approve; other uploads log upload_hold_skipped and are left alone. The managed PR comment leaves a held file out and adds one line with the held count and uploads approve --pr <n>. Public feeds and galleries return it as withheld, and GET /public/files/... answers 401 auth_required. On hosted storage the hold writes a read-gate row. An image URL returns a "Held for review" card until approval deletes that row. Any other raw URL returns 404. The bytes stay in the public bucket. A BYO bucket's domain keeps serving. GET …/files/held lists held keys and GET …/files/held/download?key= returns the public object of a hosted hold. Only a signed-in member of the workspace can call it. The file page shows those bytes to that member. The public image URL stays the Held for review card. POST /v1/workspaces/:workspace/files/approve?key= (files:write) records a release for these bytes and re-syncs the comment. Any workspace member can call it, from a session or from a token with files:write. It does not write ai.hold. The release is stored for the content hash and applies to every key that has its own hold row. A key with no hold row is not held. uploads meta get shows ai.hold=approved after a release, with who released it and when. Pass expected_sha (the sha from GET …/files/review or GET …/files/held) to bind the action to the bytes you reviewed. A different hash answers 409 content_hash_mismatch. POST …/files/hold?key= puts those bytes back under review and accepts the same expected_sha. GET …/files/review?key= returns hold, by, at, and sha for members. The file page uses it for the Reviewed note. A workspace record with holdFlaggedUploads: false writes no holds.

Usage ledger and budgets

GET /v1/:workspace/usage returns durable workspace counters (bytes, objects, uploadsInPeriod for the UTC calendar month), updated best-effort after put/delete. Keyed by workspace, not token. Overwrites adjust bytes by size delta; deletes free bytes/objects but not the monthly upload count.

When the workspace record sets budgets (maxStorageBytes, maxUploadsPerPeriod), the response also includes those caps and remaining headroom. Puts that would exceed them fail with (fields on error):

HTTP type code Meaning
403 insufficient_storage storage_quota_exceeded Net stored bytes would exceed maxStorageBytes
429 rate_limited upload_budget_exceeded Monthly put count would exceed maxUploadsPerPeriod
400 validation key_prefix_not_allowed Key not under allowedKeyPrefixes (put/sign)
400 validation key_too_deep Key path segments exceed maxKeyDepth

Configure limits with pnpm workspace:limits <name> … (see workspaces). Bare keys are rewritten to f/<id>/<name> before policy checks; presign uses the same finalization as put.

Rate limits

Bursts are bounded per workspace. Each budget is separate and never draws from another, so a read cannot exhaust a write allowance. Reads have two tiers:

Tier Applies to
normal A listing you asked not to hydrate (?metadata=0), file-url, a single object
tight files/search, files/facets, files/by-path, a metadata-hydrated listing

The tight tier exists because those shapes fan out with per-row work. A listing that skips hydration also skips the tighter bound. A caller that discards metadata therefore pays neither cost. Writes, renders, poster generation, and the public intake endpoints keep their own separate budgets, unchanged.

Both tiers are sized well above normal application and CLI traffic. They exist to stop a runaway loop, not to pace ordinary use.

A request refused by one of these burst limiters answers 429 with type: rate_limited and:

  • Retry-After — seconds to wait, the standard header.
  • X-Retry-After — the same value, kept for compatibility with callers that read the older spelling.
  • error.details.retry_after — the same value on the body.

Waiting that long is always sufficient.

Not every 429 carries that metadata. upload_budget_exceeded reports a monthly budget rather than a burst, and it recovers at the start of the next UTC calendar month rather than after a countable delay. It therefore omits both headers and retry_after instead of publishing a figure it cannot compute.

No RateLimit-Limit, RateLimit-Remaining, or RateLimit-Reset header is sent on any response. The underlying limiter reports only whether a request was allowed, so there is no accurate quota or reset instant to publish. A fabricated one would make clients back off at the wrong time.

Maintenance operations

Reconcile (potentially expensive). This operation scans every object under the workspace prefix and replaces ledger bytes/objects (monthly upload count is preserved). Use after external deletes or if counters look wrong:

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://api.uploads.sh/v1/$WS/usage/reconcile

Purge expired (destructive). This operation permanently deletes objects whose store last-modified is older than retentionDays on the workspace record, then reconciles. Skips with { "skipped": true } when retention is unset.

Example

curl -X PUT https://api.uploads.sh/v1/default/files/screenshots/myapp/42/shot.png \
  -H "Authorization: Bearer $UPLOADS_TOKEN" \
  -H "Content-Type: image/png" \
  --data-binary @shot.png

CLI

The @buildinternet/uploads package wraps the API for GitHub image embeds. Examples assume the CLI is installed globally (uploads); use pnpm uploads … only when developing inside this monorepo.

uploads put <file>
uploads put <file> --pr <num>   # PR attachment + managed GitHub comment by default
uploads gallery create --title "Release screenshots"
uploads put <file> --gallery <gallery-id>
uploads usage
uploads reconcile
uploads purge-expired

See skills/uploads-cli/SKILL.md for agent-oriented usage.