> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sfcompute.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the API

> Authenticate and make your first API request

<Warning>
  This feature is in [public preview](/preview/roadmap).
</Warning>

The Preview API is hosted at `https://api.sfcompute.com/preview/v2`. All requests require a
Bearer token.

## Create an API token

```bash theme={null}
sf tokens create --name my-token
```

This prints a token starting with `sk_live_`. Save it somewhere safe - you will not be able to
retrieve it again.

## Grant permissions

Tokens start with no permissions. Grant access to the resources your token needs.

```bash theme={null}
sf grants create --token my-token --role admin --workspace my-workspace
```

See [Roles](/preview/roles) and [Grants](/preview/grants) for how permissions work, and the
[Quick Start](/preview/quick-start) for more on workspaces.

## Make a request

```bash theme={null}
curl https://api.sfcompute.com/preview/v2/pools \
  -H "Authorization: Bearer sk_live_..."
```

## API reference

The full API reference is available in the sidebar. The reference is auto-generated from our OpenAPI
spec and covers all available endpoints, request parameters, and response shapes.
