The Trellis API uses a two-step authentication flow:Documentation Index
Fetch the complete documentation index at: https://docs.trellis.sh/llms.txt
Use this file to discover all available pages before exploring further.
- Exchange your API key for a JWT token.
- Use the JWT token to authenticate every subsequent request.
Obtaining an API key
API keys are provisioned through the Trellis admin dashboard. Contact your organization administrator or reach out to Trellis support to obtain one.Authentication flow
Step 1: Exchange API key for JWT
To start a session, send your API key and the user’s email address to the authenticate endpoint.- cURL
- Python
- JavaScript
If the email address doesn’t exist in your organization, Trellis will automatically create a new user account.
Step 2: Use the JWT token
Include the JWT token in theAuthorization header for all API requests:
Token expiration
JWT tokens expire 6 hours after they are issued. Theexpires_at field in the authentication response tells you exactly when.
When a token expires, you’ll receive a 401 Unauthorized response. Simply re-authenticate to get a new token.
Token identity (jti) and rate-limit buckets
Every JWT issued by /v1/authenticate carries a unique jti (JSON Web Token ID) claim — a v4 UUID generated at sign time. Trellis uses jti as the bucket key for rate limits and the WebSocket concurrent-connection cap.
Practical implications:
- Re-authenticating returns a fresh
jti, so a new token resets every per-token throttle and concurrency slot. - Two services sharing one JWT also share its rate-limit and connection budgets. Issue separate tokens to separate them.
- The
jtiis opaque — clients don’t need to inspect or echo it; just keep using thetokenstring.
Error responses
| Status | Error | Description |
|---|---|---|
| 400 | Invalid email format | The email address is not properly formatted |
| 401 | Missing X-API-Key header | No API key was provided |
| 401 | Invalid API key | The API key is incorrect or revoked |
| 500 | JWT signing not configured | Server-side configuration error |