Trillet AI logo

Authentication

Learn how to authenticate your API requests

Customer API calls use two headers: x-api-key and x-workspace-id. Send both on every request.

curl https://api.trillet.ai/v1/api/workspaces \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json"
x-api-keystringrequired

API key for the call. Generate it in the Trillet settings dashboard.

x-workspace-idstringrequired

Workspace the request applies to. Required on customer API calls.

Content-Typestringrequired

Set to application/json for JSON bodies. File uploads use multipart/form-data.

Authorization: Bearer is a dashboard session token. The API key belongs in x-api-key.

Obtaining API Keys

Generate an API key under the Settings tab. Each key has its own permissions and limits.

Get your API key from the Trillet Settings Dashboard.

Security Best Practices

  1. Keep API keys on your server. A browser or mobile app should use a short-lived SDK token from Create SDK Token.
  2. Rotate API keys periodically.
  3. Use different API keys for development and production.
  4. Watch key usage for unexpected traffic.