Trillet AI logo

Create SDK Token

Mint an SDK token for a workspace. The token is valid for 24 hours.

POSThttps://api.trillet.ai/v1/api/calls/sdk/auth

Mints a signed SDK token tied to your API key and workspace.

No endpoint accepts this token yet. Connect a Web Call rejects it with 401 {"error": "Invalid token"}. Until that changes, start web calls from your server with your API key, and keep the key off the client.

Headers

x-api-keystringrequired

Your API key. This endpoint reads it directly: a dashboard session token is not enough, and the request fails with 400 without it.

x-workspace-idstringrequired

Workspace identifier for the API. The key's user must be a member of this workspace.

Response Fields

statusstring

success.

sdk_tokenstring

The SDK token.

expires_innumber

Seconds until the token expires: 86400 (24 hours).

Errors

StatusBodyWhen
400{"error": "Missing required headers: x-api-key and x-workspace-id are required"}A header is missing
401{"error": "Unauthorized Api Key"}The API key is not valid
403{"error": "Unauthorized API key. User is not included in the workspace."}The key's user isn't in that workspace
500{"error": "Internal server error"}Server error
{
  "status": "success",
  "sdk_token": "eyJ3b3Jrc3BhY2VJZCI6IjY2NGExYjJj...",
  "expires_in": 86400
}

Last updated on