Authentication
Fleet uses API keys to authenticate all requests. Keys are tied to your account and grant full access. Treat them like passwords.
Getting a key
Log in with the CLI:
fleet login
This opens a browser window, authenticates via your Fleet account, and saves a key locally at ~/.fleet/credentials. The SDK and CLI read it automatically, with no environment variables needed.
You can also generate a key from the API Keys page in the dashboard.
Using a key
CLI: credentials are loaded automatically after fleet login. To use a specific key:
FLEET_API_KEY=fleet_sk_... fleet jobs
SDK: credentials are loaded automatically from ~/.fleet/credentials. To pass a key explicitly:
from fleet import Fleet
client = Fleet(api_key="fleet_sk_...")
Environment variable: the SDK also reads FLEET_API_KEY if set:
export FLEET_API_KEY="fleet_sk_..."
client = Fleet() # picks up FLEET_API_KEY automatically
Checking your identity
fleet whoami
Email: you@example.com
User ID: user_abc123
Or from Python:
info = client._http.get("/v1/auth/me")
print(info["email"])
Logging out
fleet logout
This removes the saved credentials from ~/.fleet/credentials.

