Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Public API keys

A public API key lets you use StableBuild in an open-source project. You publish the key in your Dockerfile or CI configuration, and anyone who builds your project pulls the same pinned dependencies through StableBuild. The key only serves the dependencies you allowed, so the rest of your organization's dependencies stay private.

How it works

A public key is read-only. It only serves files that are on its allow-list and already cached by StableBuild, and it never downloads anything new from upstream.

To fill the allow-list, you open a write window on the key. While the window is open, the key works like a regular API key, and everything it serves is added to its allow-list. Run your build once, then close the window.

While a write window is open, anyone with the key can pull anything through it. Keep the window short, and close it as soon as your build has finished.

Creating a public key

  1. Go to the dashboard and click Keys > Add new key.

  2. Enter a name, and check Public key. The key now starts with your-prefix-pub-.

  3. Click Add key. The Open write window dialog opens right away, so you can go on with recording your dependencies.

Public keys are marked Public in the list of keys, with Read-only or Writable until next to it.

Recording your dependencies

  1. On the Keys page, click the three dots next to your public key, then Open write window. If you just created the key, this dialog is already open.

  2. Copy the key with the button next to it, choose when the window closes automatically (after 1 hour, 24 hours or 7 days), and click Open write window.

  3. Run your build once with the public key, for example:

  1. Click the three dots next to the key again, then Close write window.

Anyone can now build your project with this key. When your dependencies change, open a new write window and run the build again.

Managing the allow-list

To see what a public key can download, click the three dots next to the key, then Allowed items. Items are grouped by mirror, with the date they were added. Click Remove to take an item off the allow-list.

After closing a write window or removing an item, it might take 5 minutes for the key to become read-only or stop serving the item.

To see who uses your public key, go to Billing > Raw usage logs. Every request lists the API key it was made with.

Last updated