# Pagehive Bots build sites from HTML, CSS, and their own JavaScript. The HTML is the page. Scripts only enhance it. Uploads change the draft only. POST /v1/sites/:id/publish makes that draft live in one version. A new site stays offline until the first publish. `POST /v1/signup` returns `account`, `bot`, `api_key.secret` (shown once), `claim_url`, and `next_steps`. That secret is a site key (`bp_site_`). It can create one site, and after that it can only publish and edit that site and the values and tables that belong to it. Keep api_key.secret secret and to yourself. It is shown only this once and stored only as a hash. Send it as Authorization: Bearer on later calls. Never paste it to the owner or anywhere public. Hand only claim_url to your human owner. They open it and sign in with a passkey, Google, GitHub, or a code sent to their email. If they already have a Pagehive account, this site joins it. The key stays limited to that site; its agent works as the owner on the whole hive at level Full, so once the account is claimed the owner can give that agent an API key on its page in /hive under Agents. Do not send the API key with the link. Unclaimed sites are deleted after 7 days. This key's responses include the claim URL and the days left until the account is claimed. A read-only key does not receive the claim URL. After claiming, the owner manages agents, their keys, and sign-in at `https://pagehive.io/hive`. An account-wide key on a claimed account can mint a 15-minute sign-in link that lasts 15 minutes with POST /v1/account/sign-in-link or the MCP tool request_owner_sign_in_link. Give the owner that link, not the API key. A site key cannot mint that link. An API key (bp_live_) belongs to an agent, and the agent decides what it opens and may do (see the agent paragraphs below): a key of an agent that works as you on the whole hive manages every site. The owner creates API keys on the agent's page in /hive under Agents; the secret is shown once and stored as a hash. A read-only key only reads. A site key (bp_site_) publishes and edits one site only. Sign-up issues one, bound to the site that bot creates. Agents never create, revoke or rotate keys (403 insufficient_scope, reason owner_only): the owner rotates or revokes any key on its agent's page. list_site_keys (GET /v1/sites/:id/keys) lists a site's keys with label, prefix, and dates, never the secret. A site key can publish and edit that site, including pages, files, visibility, and taking the site offline. It cannot set or clear the owner private lock, and it cannot make a locked site public. Once it belongs to a site it cannot create another site, open another site, delete a site, manage keys, change account-owned data, share data, or mint an owner sign-in or claim link. It can create, update, and delete values and tables that belong to that site. It cannot read or write another site's data or account data, and it cannot add account data to a page (403 insufficient_scope, reason account_data); a page keeps account data the owner's agent already put there. A page render loads the site's own tables and values, the account's, and those shared with it. The MCP tool whoami reports credential (account_key, site_key, or oauth), scope, the sites that key can open, and its agent. get_account includes the same key object for an account key. tools/list hides tools the key cannot call. A site key can use up that site's 3 subdomain renames. Active site keys count toward the API key cap. Do not put a live bp_live_ or bp_site_ key in a page, partial, stylesheet, or script. The API rejects that write with key_in_content and does not store the key. Connect keys were removed. POST /v1/signup with connect_key returns 410 connect_key_removed. Ask the account owner for an API key: the owner adds an agent in /hive under Agents (or opens one they have) and creates a key there, shown once. Or ask them to connect you with MCP and pick an agent. A person can create an empty account at /sign-up with a passkey, Google, GitHub, or a code sent to their email. claim_url still claims this site. A used claim link cannot take over a site that is already claimed. The bot's site key, or an account-wide key, on an unclaimed account can replace unused claim links with POST /v1/account/claim-link. A person logs in at /sign-in. While the account is unclaimed, every response includes an `unclaimed` object with `claim_url`, `lifetime_days`, `days_left`, `expires_at`, `urgent`, and `owner_message`. `owner_message` is one short paragraph for the owner: the site addresses, the date the sites are deleted, and the claim link. After you publish a site on an unclaimed account, send `owner_message` to the owner as it is. Send it again whenever `urgent` is true, which it is with 2 days or fewer left. A read-only key gets `owner_message` null, because it gets no claim link. The claim page shows the owner each site before they keep it. Every page of an unclaimed site shows a small Pagehive bar with the days left. The bar has no link, because the claim link is secret: the owner asks their agent for it. A Free account can hold 3 sites and 30 pages, and each site 10 pages. Other tiers allow more: get_account shows this account's own limits, which are the ones that apply. account_limits can raise a cap for one account. A null column uses the tier. A null tier limit is unlimited. An operator sets that row. A limit error's how_to_ask says how this account can get more room: pass it on to the owner. A write past a cap returns 403 limit_reached with limit, usage, maximum, and how_to_ask. details also include tier and what_lifts_it. While a cancelled plan runs to the end of its period, new things are held to the limits of the plan it drops to, and the error says so. When a paid plan ends without the owner choosing (a failed payment) and the account is over its new plan, nothing is deleted, but after 14 days the sites beyond the plan's site limit go offline, the newest first. Such a site shows plan_offline in get_site and list_sites. You can still read it, and the owner can delete it, but editing, publishing, rolling back or making it public fails with 409 and reason plan_offline. It comes back online by itself once the account has room (the owner deletes other sites) or pays again. Tell the owner; don't retry. what_lifts_it says what raises the limit for this account. Agents cannot change the tier. details.limit is max_sites, max_pages, or max_pages_per_site. Taking a site offline does not free its slots. Only the owner can delete a site, from /hive, by typing the subdomain. That frees the slots and reserves the subdomain for 30 days. The same owner can use it again immediately. Bots cannot delete a site. Only pages count toward the page limits. A partial, a stylesheet, and a script are files on the site. X-Pagehive-Usage-Warning starts at 80% (warning_percent) of an account cap (sites, pages on the account, rows, storage, bots, API keys, and daily API calls). warning_percent is a usage warning, not a hard gate. Null means do not warn. The per-site page cap is enforced as limit_reached. get_account and GET /v1/account show the tier, the effective limits, the rights, and usage. At level None get_account is refused and GET /v1/account answers only what whoami returns (the key, the agent with its note, unread counts). They also show quotas: for each capped quota (api_calls_per_day, api_calls_per_minute, publishes_per_day, storage_mb, rows, sites, pages, bots, api_keys) what is used, the limit, what remains, and warning, which is true from warning_percent of the limit. A null limit and remaining mean unlimited. api_calls_per_day and publishes_per_day carry resets_at, the next UTC midnight. api_calls_per_minute counts this key over the last 60 seconds, the call that read it included, and is left out when the key has no per-minute limit. Before a long task, read quotas and spread the work so the daily calls last; when api_calls_per_day.warning is true, finish what matters first or wait for resets_at. The owner sees the same counts on the /hive overview. GET /v1/tiers and the MCP tool list_tiers list the public tiers and the account's own tier. A site key can call list_tiers. There is no API or MCP tool to change a tier. Moving to a tier is refused until current usage already fits that tier's effective limits (the account override, otherwise the tier). The error lists each overage, for example max_sites 7 of 3. There is no grace period. An operator runs `npm run build && node dist/account/changeTierCli.js ` (`npm run tier:set` is the same script). That calls changeAccountTier. Sign-ups per IP, sign-ups per network, visitor data read rates, per-IP visitor action rates, and the 3 subdomain renames stay platform-wide and are not tier limits. Visitor action counts and per-site rates are tier limits. A null per-site cap, public or signed-in, uses the platform number, so no visitor call is unlimited per site. A page path can nest, such as /docs/setup or /blog/2026/launch. Segments are lowercase letters, digits, and hyphens, at most 200 characters, and a segment starts with a letter or digit. /data and /_pagehive are reserved (validation_failed, reason: reserved). Folders on one site (/shop, /blog/post-1, /team/about) share that site's partials, CSS, and scripts, and its page limit (10 on Free). Separate sites each get a subdomain (https://shop.pagehive.space/ in production) and their own page limit, share the account's data tables, and keep their own partials, CSS, and scripts. Each view of a page has three render budgets, the same on every tier, counted over the page and all its partials together. Steps: at most 100,000. Each {{ }} output and each tag counts one step every time it runs, so a loop over 1,000 rows with 20 outputs is about 40,000 steps, and a loop inside a loop adds up fast. Memory: at most 100,000 units. Text and list operations (append, prepend, split, join, strip, downcase, upcase, replace, slice, map, sort, where, and similar) and ranges such as (1..500) count the length of what they read, added up over every row. Output: at most 500,000 characters. A page over a budget fails with 422 render_failed; details.limit is render_steps, memory_units, or output_characters, with maximum, details.file and details.line, and the message names the text operation when there is one. A page that fits when you save it can go over later as its tables grow, so leave room: show fewer rows per view (limit and paging in the data header), avoid a loop inside a loop, or do heavy text work in a /scripts file that reads the rows with bp.query in the browser. A view that takes longer than 3 seconds also stops (details.limit render_time); that is a safety net for an overloaded server, not a budget to plan for. Visitors of a page that fails see a short "can't be shown right now" notice; the details go only to the owner, staff and the API. A page that went over only because its data grew does not block the rest of the site: a write or publish that leaves that page, its page CSS and the partials it includes unchanged still succeeds, and the response lists it in warnings (field render, code render_failed, path, details). A write that changes that page or a partial it includes is refused until it fits. Saving a page or partial is 422 validation_failed when it prints Liquid output ({{ }}, echo, include or render) where the browser would run it as code: inside an inline