Skip to main content

tetrate agentrouter identity token

Generate a JWT token from a service account file.

If no file is specified, defaults to 'identity.json' in the current directory.

The service account file can be in either the wrapped API response format:
{
"serviceAccount": { /* service account config */ },
"checksum": "...",
"checksumAlgorithm": "sha256"
}
or the naked format (direct service account JSON without wrapper).

Examples:
# Generate a token from service-account.json in current directory
tetrate agentrouter identity token

# Generate a token from a specific file
tetrate agentrouter identity token path/to/service-account.json

# Generate a token with 24 hour TTL
tetrate agentrouter identity token --ttl 24h

# Generate a token with 30 minutes TTL
tetrate agentrouter identity token --ttl 30m

# Generate with custom claims
tetrate agentrouter identity token --claim router_id:123 --claim "user:john doe"

# Output as JSON with metadata
tetrate agentrouter identity token --format json --pretty

# Use in curl command
curl -H "Authorization: Bearer $(tetrate agentrouter identity token)" https://api.tetrate.ai/v1/models

Usage:
tetrate agentrouter identity token [identity.json] [flags]

Flags:
-c, --claim strings Custom claim as key:value (can be repeated)
-f, --format string Output format: 'token' (default) or 'json' (default "token")
-p, --pretty Pretty print JSON output (only for --format=json)
-t, --ttl string Token TTL as duration (e.g., 1h, 30m, 2h30m) (default "1h")

Global Flags:
-q, --quiet Suppress progress output; only errors and the final summary go to stderr
-v, --verbose Verbose output: plain-mode progress lines plus full per-blob chunk logs to stderr