Authentication
Labelty supports browser sessions (for the web app) and project API keys (for SDK, cURL, CI, and workflow run calls).
This page focuses on project API keys, because that is what automation and the Python SDK use.
What a project API key is
Section titled “What a project API key is”- The secret starts with
lty_ - It belongs to exactly one project
- The project is resolved from the key — you do not need a separate
LABELTY_PROJECT_IDfor the SDK - You send it as:
Authorization: Bearer lty_…
Who can create a key
Section titled “Who can create a key”Creating and managing keys requires the appropriate organization permission (commonly described as API key manage / org.api_keys.manage in the product). Typical roles that can use ML automation include ML Engineer and Project Manager.
Create a key in the UI
Section titled “Create a key in the UI”- Sign in to the Labelty web app.
- Open your project.
- In the project navigation, open API Key
(route shape:/dashboard/project/{id}/api-key). - Create a new key:
- Give it a clear name (for example
ci-trainingorlocal-dev). - Choose an expiry if offered (never / 30 days / 1 year — options depend on the UI).
- Give it a clear name (for example
- Copy the secret immediately. Labelty shows the full
lty_…value at create time; you typically cannot read it again later. - Store it somewhere safe (password manager, CI secret store, or a local
.envthat is gitignored).
Screenshot: Project → API Key → Create key dialog (copy secret once)
Store the key locally
Section titled “Store the key locally”Create a .env file outside version control (or export variables in your shell):
# Example — do not commit real valuesexport LABELTY_API_URL="https://api.development.labelty.ai/api/v1"export LABELTY_API_KEY="lty_your_secret_here"On Windows PowerShell:
$env:LABELTY_API_URL = "https://api.development.labelty.ai/api/v1"$env:LABELTY_API_KEY = "lty_your_secret_here"Use the key with HTTP
Section titled “Use the key with HTTP”curl -s "https://api.development.labelty.ai/api/v1/projects/current" \ -H "Authorization: Bearer $LABELTY_API_KEY" \ -H "Content-Type: application/json"What this does: asks Labelty which project this key belongs to.
Why it is useful: confirms the key works before you write Python or deploy a workflow.
Expected output: a JSON envelope with data.id, data.name, and other project fields.
Common errors:
| Symptom | Likely cause |
|---|---|
401 |
Missing/wrong key, or key revoked |
403 |
Key valid but action not allowed for this key / plan |
| Empty / connection error | Wrong host, VPN, or TLS issues |
Use the key with the SDK
Section titled “Use the key with the SDK”The client does not auto-read environment variables. Pass them explicitly:
import osfrom labelty_sdk import LabeltyClient
with LabeltyClient( api_url=os.environ["LABELTY_API_URL"], api_key=os.environ["LABELTY_API_KEY"],) as client: project = client.project print(project.id, project.name)API-key mutation allowlist
Section titled “API-key mutation allowlist”Project API keys can call many GET endpoints. Write operations are restricted to an allowlist (for example training runs, workflow run, some model operations). If a write returns 403 while a session user can do it in the UI, the endpoint may not be allowlisted for keys yet.
Next step
Section titled “Next step”Install the SDK: Install and connect.