API Keys and Scopes

A key authenticates as you, limited to the scopes you grant.

Updated Dec 1, 2026

An API key lets a script, a CI job or a tool act on your account without your password. It carries exactly the scopes you choose, and nothing more.

Create a key

  1. Go to Settings, then Developer, and open the API keys tab.
  2. Under New key, give it a name you will recognise later, for example CI deploy bot.
  3. Tick the scopes it needs. All and Clear select or clear every scope at once.
  4. Click Create key.
  5. Copy the key right away. It is shown once (It will not be shown again). If you lose it, revoke it and create another.

A key starts with bhk_ followed by 48 characters. Keys do not expire. You can hold up to 25 active keys at once.

Use a key

Send it as a bearer token in the Authorization header.

curl https://bot-hosting.net/api/v1/account \
  -H "Authorization: Bearer bhk_your_key"

The full list of operations is on REST API. The same key also works with the MCP server and the CLI.

Revoke a key

In the API keys tab, click Revoke next to the key. It stops working immediately. Each key shows when it was created and when it was last used (or never used), which helps you spot keys nobody needs any more.

Scopes

Each operation needs one scope. A key without it gets a 403 with the code insufficient_scope.

Deployments

Scope Allows
deployments:read List and inspect deployments, read logs, resources, startup settings and the linked repository
deployments:power Start, stop, restart and kill, and send a line to the console
deployments:write Create, rename, delete, resize and move deployments, change startup settings, pull from GitHub, manage domains
deployments:shell Run shell commands in a deployment's container
projects:read List your projects
projects:write Create and delete projects
files:read Browse, read, search and download files
files:write Upload, write, edit, rename, move and delete files
env:read Read environment variables (secret values stay masked)
env:write Set, update and delete environment variables
backups:read List restore points
backups:write Restore a restore point
packages:read View installed packages
packages:write Add and remove packages

Account

Scope Allows
account:read Read your profile, credit balance, plan and quota
billing:read Read invoices and plan
credits:spend Spend credits to create resources

Templates and documentation

Scope Allows
templates:read Browse anyone's public templates
docs:read Search and read the Bot-Hosting documentation

Operations that need two scopes

  • Reading the SFTP details of a deployment (which include a live password) needs deployments:read and deployments:write.
  • Rotating a database password needs deployments:write and deployments:read.

The CLI key

The Open in IDE button in the Files tab of a deployment creates a key named CLI in one click, limited to what the CLI needs (account:read, deployments:read, deployments:power, files:read, files:write, env:read and env:write). It appears in your API keys like any other and can be revoked the same way.

Keep keys safe

  • Treat a key like a password. Anyone who has it acts as you, within its scopes.
  • Never commit a key to a repository or paste it in a public channel. If it leaks, revoke it at once.
  • Prefer several narrow keys over one key with every scope.
  • A key works on every deployment your account can reach, including deployments shared with you.