Skip to main content
Every call to BoxLite Cloud carries one credential: an API key you create in the console and send as a bearer token. There is no local runtime to fall back on and no permissive mode — a request without a valid key does not create a box.

What a key grants

A key gives its holder access to the Boxes API, which the console states as: this key can create and manage Boxes. Shared Linux base images are available automatically. That means the holder can create, start, inspect, and remove boxes on your account, and pull the shared Linux base images without any extra image setup. Treat a key as a fleet-level credential, not a read-only token. Anyone who has it can spend your account’s capacity.

Create a key in the console

Sign in to the console at https://app.boxlite.ai, open API Keys, and click Create Key. The dialog asks for two things: The full key is shown once, at creation. Copy it before you close the dialog — from then on the list view shows only a masked form such as blk_live_********************UHK. The list view gives you one row per key with these columns:

Give the key to your code

BoxLite Cloud reads two environment variables. Both the SDKs and the CLI use the same names, so one export pair serves all of them:
Read the key from the environment at runtime and pass it as an ApiKeyCredential. The snippets below construct a client and list your boxes, which is the cheapest way to prove a credential works.

Load the whole configuration from the environment

BoxliteRestOptions.from_env() builds the options object for you, wrapping BOXLITE_API_KEY into an ApiKeyCredential automatically. It is the shortest correct form for CI jobs and services, where the credential is injected by the platform rather than typed by a person.
For the full list of variables from_env() reads, see Manage remote sandboxes over REST. One of them, BOXLITE_REST_PATH_PREFIX, exists for self-hosted control planes — leave it unset for Cloud, and see the path_prefix row under Troubleshooting below.

Persist credentials for the CLI

Exports live and die with a shell. boxlite auth login writes the credential to a profile in ~/.boxlite/credentials.toml instead, so every later boxlite command in every shell finds it.
Profiles let one machine hold several identities. Each profile stores its own URL, bearer, and route prefix; --profile <NAME> or BOXLITE_PROFILE selects one, and the default profile is named default.
One interaction is worth knowing before it surprises you: BOXLITE_API_KEY in the environment overrides only the bearer from the stored profile, not the profile’s URL or route prefix. A stale export can therefore send the wrong key to the right service. For the complete flag table, see boxlite auth.

Handle keys safely

  • Never commit a key, and never put it in argv. Both source control and shell history are searchable forever. Read the key with read -rs and pass it through the environment or over stdin, as the snippets above do.
  • Use one key per environment. Separate keys for local development, CI, and production mean the LAST USED column tells you something, and a leak from CI does not force you to re-credential your laptop.
  • Set an expiry when the key has a known lifetime. A key issued for a two-week migration should stop working in two weeks, not in two years.
  • Rotate by creating first, deleting second. Create the replacement key, deploy it everywhere the old key was used, confirm traffic on the new key, and only then delete the old one. Deleting first means every box the old key manages goes unreachable until the new key lands.
  • Give agents the narrowest key you can. A key holder can create and remove boxes on your account, so an agent that only needs one box still gets a key that could remove them all — keep that key on your infrastructure and out of any prompt or model context.

Troubleshooting

Next steps

Cloud quickstart

Use the key you just created to run your first command inside a Cloud box.

Boxes

Pick an image and a size, and learn the lifecycle controls Cloud applies while a box runs.