Account and authentication
You need an account before you can run anything. The CLI needs no API key: it holds a session for you, the dashboard signs you in with the same account, and the REST API takes an access token the CLI prints for you. Inference endpoints use separate API keys (Inference endpoint).
Create an account and sign in to the CLI
Section titled “Create an account and sign in to the CLI”This is the fastest way, and it leaves you signed in. It needs the CLI. If you do not have it yet, install it first: Ways to use distil labs.
distil signup
The command prints a short code and opens the distil labs sign-in page in your browser. On that page:
- Create an account, or sign in if you already have one.
- Check that the code on the page matches the one in your terminal, and confirm it.
The command then prints Logged in as <email> and you are signed in.
Create an account from the browser
Section titled “Create an account from the browser”Sign up at app.distillabs.ai/sign-up. This creates the same
account, but it gives the CLI no session, so bring the account to your terminal with distil auth
before you run anything.
Sign in to the CLI
Section titled “Sign in to the CLI”Sign in with an existing account:
distil auth
This is the same flow as distil signup: confirm the code in your browser and the CLI picks up the
session.
The browser does not have to be on the same machine. If the CLI cannot open one, a remote shell for example, it prints the address instead. Open it on any device, sign in, and confirm the code.
Check who you are signed in as, or sign out:
distil whoami
distil logout
The CLI keeps its own session, in ~/.config/distillabs/session.json (under $XDG_CONFIG_HOME
when that is set), and refreshes it for you. A run spanning several hours will not ask you to log
in again.
Sign in to the dashboard
Section titled “Sign in to the dashboard”Go to app.distillabs.ai and sign in with the same account.
The dashboard is read-only. It lists your models, datasets and traces, and you start every job from the CLI or the REST API. See Ways to use distil labs.
Authenticate with the REST API
Section titled “Authenticate with the REST API”The REST API takes a bearer token from the CLI. Sign in to the CLI first, then print a token:
distil access-token
Each run refreshes the session and prints a new access token, and only the token, so it drops straight into a header:
curl -H "Authorization: Bearer $(distil access-token)" https://api.distillabs.ai/datasets
Access tokens are short-lived, much shorter than a training run, so fetch one per request rather than holding it:
response = requests.get(
"https://api.distillabs.ai/datasets",
headers=auth(),
)
Using the REST API has the auth() helper that calls
distil access-token, along with the rest of the helpers the API examples depend on. Do not copy
the auth block on its own. The surrounding helpers handle the error bodies where validation
failures actually live.
Troubleshooting
Section titled “Troubleshooting”If the API rejects a token, fetch a new one with distil access-token rather than reusing the old
one. Sign-in errors and their fixes: Troubleshooting.
You have an account. Now build a model, or pick your task type first with Task selection.