# BYOS Blue > BYOS Blue (Bring Your Own Storage) is a regional object storage with a simple REST API. Files are uploaded and downloaded with an API-Key; the nearest datacenter (node) is selected automatically from the geolocation of the client IP, or from the headers `ip` or `lat`/`lng`. Price: 12 USD per year for every started 25 GB (current values: `GET https://byos.dnsdyn.top/api/pricing`). Base URL of the API: `https://byos.dnsdyn.top/api`. All headers use hyphens (`api-key`, `api-key-source`, `api-key-target`); headers with underscores are dropped by the proxy. ## Getting an API-Key 1. `POST /users` with JSON `{"email": "you@example.com"}`. An activation eMail is sent. 2. Open the link in the eMail (or call `GET /activation/{code}`); the response is `{"api_key": "..."}` and the key is also sent by eMail. ## Files - Upload: `POST /objects` with header `api-key`. The master answers `307` with `Location` pointing to the storage node; repeat the POST there with the file as body. Send the first request without body: the master does not accept request bodies above 10 MB. Optional headers: `filename`, `comment` (UTF-8), `sha256sum` (verified), `ip` or `lat`/`lng` (location used to choose the node). Response `201 {"id": "...", "url": "..."}`. Files above the maximum size are rejected with `413`. - Download: `GET /objects/{id}` with `api-key`, `307` to the node. The node returns the stored filename in `Content-Disposition` and supports `Range` requests (`206`), so downloads can be resumed and videos can be seeked. - List: `GET /objects` returns size, SHA-256, filename, comment, creation time, node with coordinates and the API-Key the object was uploaded with. - Delete: `DELETE /objects/{id}`. - Transfer to another account: `GET /chown/{id}` with headers `api-key-source` (owner) and `api-key-target` (recipient); many objects at once with `POST /chown` and JSON `{"ids": [...]}` (up to 10000), answer `{"transferred": [...], "not_transferred": [...]}`. ## Account - `GET /account`: objects, bytes, replica bytes, billable bytes, storage blocks, price, yearly cost, billing year. - `GET /settings`, `PUT /settings` with JSON `{"replicas": n}`: additional copies of each file on the nearest other nodes (default 0, at most `max_replicas`). A background worker creates missing replicas right after each upload and removes surplus ones. Each replica is billed like regular storage; downloads come from the copy nearest to the client and fail over to another copy if a node is down. `GET /settings/preview?replicas=n` (optional `key`) returns current and resulting cost. - Two-factor authentication for the web login only: `POST /2fa/setup` (secret, `otpauth_uri`, `qr_svg`), `POST /2fa/enable` and `POST /2fa/disable` with `{"code": "123456"}`, `POST /login` (used by the customer area; 401 `two_factor_required`, 429 after 5 wrong codes). API requests with an API-Key are not affected. - `GET /api_keys`, `POST /api_keys` (JSON `{"name": "..."}` optional), `PUT /api_keys/{key}` (`{"name": "..."}` and/or `{"replicas": n}`, `null` = account value), `DELETE /api_keys/{key}` (not the last key). - `GET /invoices`, `GET /invoices/{number}` (PDF). Billing is yearly from the activation date; growing into an additional block is invoiced pro rata immediately. - `DELETE /users`: delete the account (only when it holds no objects). ## Status codes 400 invalid input, 401 unknown API-Key or foreign object, 403 forbidden, 404 not found, 409 conflict, 413 file too large, 503 temporarily unavailable. ## Resources - [OpenAPI description](https://byos.dnsdyn.top/openapi.yaml) - [curl example](https://byos.dnsdyn.top/examples/curl.sh), [Python](https://byos.dnsdyn.top/examples/python.py), [Node.js](https://byos.dnsdyn.top/examples/javascript.mjs), [PowerShell](https://byos.dnsdyn.top/examples/powershell.ps1) — replace `__BASE_URL__` in the examples with `https://byos.dnsdyn.top/api`. - [Homepage with user area](https://byos.dnsdyn.top/), log in at `https://byos.dnsdyn.top/app/` with an API-Key.