# Buckets

Per-org object storage up to 5 GiB per object, callable through the API, MCP, bindings, or mounted as a folder under /mnt.

**Buckets** provide S3-backed object storage scoped to your organization. Workers and Sandboxes can stream objects directly through a [Bucket binding](/docs/bindings/) or mount a Bucket as a directory under `/mnt`.

## Managing Buckets & Objects

:::tabs
::tab skopik
```bash
skopik create_bucket --name uploads
skopik put_object --bucket uploads --key hello.txt --body "Hello from Skopik"
skopik list_objects --bucket uploads --prefix ""
skopik get_object --bucket uploads --key hello.txt
```
::tab curl
```bash
# Create bucket
curl -X POST https://api.platform.skopik.com/v1/buckets \
  -H "Authorization: Bearer $SKOPIK_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name": "uploads"}'

# Upload raw bytes
curl -X PUT https://api.platform.skopik.com/v1/buckets/uploads/objects/reports/q1.pdf \
  -H "Authorization: Bearer $SKOPIK_API_KEY" \
  -H "content-type: application/pdf" \
  --data-binary @q1.pdf

# List objects
curl "https://api.platform.skopik.com/v1/buckets/uploads/objects?prefix=reports/&delimiter=/" \
  -H "Authorization: Bearer $SKOPIK_API_KEY"
```
::tab MCP
```json
{
  "tool": "list_objects",
  "arguments": { "bucket": "uploads", "prefix": "reports/" }
}
```
:::

## HTTP & Binding Operations

| Operation | Control API Path | Binding Path (`SKOPIK_BINDINGS_URL`) |
| --- | --- | --- |
| **Put object** | `PUT /v1/buckets/{bucket}/objects/{key}` | `PUT /buckets/{binding}/objects/{key}` |
| **Get object** | `GET /v1/buckets/{bucket}/objects/{key}` | `GET /buckets/{binding}/objects/{key}` |
| **Head object** | `HEAD /v1/buckets/{bucket}/objects/{key}` | `HEAD /buckets/{binding}/objects/{key}` |
| **Delete object** | `DELETE /v1/buckets/{bucket}/objects/{key}` | `DELETE /buckets/{binding}/objects/{key}` |
| **List objects** | `GET /v1/buckets/{bucket}/objects` | `GET /buckets/{binding}/objects` |

- **Streaming:** Uploads and downloads stream with backpressure up to **5 GiB** per object, supporting HTTP `Range` requests, `ETag`, and `Last-Modified`.
- **Read-only bindings:** Setting `"access": "read"` on a Bucket binding permits `GET`, `HEAD`, and list, refusing `PUT` and `DELETE` with `403 binding_read_only`.

## Folder Mounts

Any Bucket binding can be mounted as a directory inside `/mnt` for tools that expect filesystem paths (`cp`, `tar`, Python `open()`). Declare both the binding and the mount in `skopik.json` (or when creating a Sandbox):

```json
{
  "bindings": {
    "DATA": { "bucket": "datasets", "access": "read" }
  },
  "mounts": {
    "/mnt/datasets": { "binding": "DATA" }
  }
}
```

> [!NOTE]
> Folder mounts are backed by the Bucket's object API via FUSE in the guest. They behave like object storage (whole-object reads/writes) rather than a POSIX block disk.
