Skip to main content
The API is available at https://api.sfcompute.com/v2. All requests require a Bearer token. The API exposes the same resource model as the CLI. Pools hold an allocation schedule, orders buy and sell compute time, and instances run on pools. If that model is new, start with Instances and Pools before wiring the API into an application.

Create an API token

Create a token with the CLI.
This prints a token starting with sk_live_. Save it somewhere safe. You can’t retrieve it again.

Grant permissions

Tokens start with no permissions. Grant access to the resources your token needs. These examples use a workspace named my-workspace; every new organization starts with one named default.
The admin role grants full access to the workspace; give production tokens a narrower role. See Roles and Grants for how permissions work, and the Quickstart for more on workspaces.

Make a request

Replace my-account with your organization name (shown by sf me or in the dashboard). Replace <token> with the token you created above.
API workflows follow the same shape as the Quickstart.
  1. Create or choose a pool.
  2. Place a buy order to add allocation.
  3. Create instances on the pool.
  4. Read pool, order, and instance state to track what happened.

API reference

Browse every endpoint, with request parameters and response shapes, in the sidebar. Start with the Pools API.