API Keys
API keys enable programmatic access to the Tank registry for CLI operations, CI/CD pipelines, and automation.Creating API Keys
Via Web UI
- Navigate to tankpkg.dev/tokens
- Click “Create New Token”
-
Configure the token:
- Token Name: Descriptive label (e.g., “CI/CD Pipeline”)
- Expires In: Days until expiration (1-365, default 90)
- Scopes: Permissions for the token
- Click “Create”
- Copy the token immediately — you won’t see it again
- Prefix:
tank_ - Length: 64 characters (prefix + 59 random bytes)
- Encoding: Base58 (URL-safe, no ambiguous characters)
Via CLI OAuth Flow
The CLI can generate tokens automatically:- CLI calls
POST /api/v1/cli-auth/start- Returns
pollTokenanduserCode
- Returns
- CLI opens browser to
/cli-auth/authorize?code={userCode} - User logs in via GitHub OAuth
- User clicks “Authorize Tank CLI”
- CLI polls
POST /api/v1/cli-auth/exchange- Exchanges
pollTokenfor API key
- Exchanges
- CLI stores API key in
~/.tank/config.json
Token Scopes
Scopes control what operations a token can perform:Available Scopes
| Scope | Permissions |
|---|---|
skills:read | Download skills, view metadata, search registry |
skills:publish | Publish new skills, update existing skills |
skills:admin | Delete skills, manage versions, moderate content |
skills:adminincludesskills:publishandskills:readskills:publishincludesskills:readskills:readis always granted (minimum permission)
Choosing Scopes
Development:Using API Keys
CLI Configuration
Store your API key in~/.tank/config.json:
Direct API Usage
Include the token in theAuthorization header:
Token Management
Listing Tokens
View all your tokens at/tokens:
| Name | Key | Created | Last Used | Expires | Scopes | Actions |
|---|---|---|---|---|---|---|
| CI/CD Pipeline | tank_abc... | Mar 3, 2026 | 2h ago | Mar 3, 2027 | skills:publish | Revoke |
| Local Dev | tank_def... | Feb 1, 2026 | Never | May 1, 2026 | skills:read | Revoke |
Revoking Tokens
- Navigate to
/tokens - Click “Revoke” next to the token
- Confirm revocation (cannot be undone)
- Token invalidated immediately
- All requests using this token return
401 Unauthorized - Cannot be unrevoked — create a new token instead
Rotating Tokens
Best practice: Rotate tokens regularlyCI/CD Integration
GitHub Actions
TANK_API_KEY: Token withskills:publishscope
GitLab CI
CircleCI
Service Accounts
For enterprise deployments, use service accounts instead of user tokens: Admin API Endpoint:- Not tied to individual user accounts
- Survives employee departures
- Easier to audit (dedicated service account logs)
- Can have stricter rate limits
Security Best Practices
Token Storage
- Never commit tokens to git
- Store in environment variables or secret managers
- Use
.gitignorefor~/.tank/config.json - Encrypt tokens at rest in databases
Token Rotation
- Rotate tokens every 90 days (default expiration)
- Rotate immediately if compromised
- Use short-lived tokens for temporary access
Scope Minimization
- Grant minimum required scopes
- Use
skills:readfor read-only operations - Reserve
skills:adminfor administrators only
Audit Logging
All token operations are logged:action:api_key.create,api_key.revokeactorId: User who performed the actiontargetId: API key IDmetadata: Token name, scopes, expiration
Rate Limits
Per Token:- Default: 1000 requests per hour
- Burst: Up to 100 requests in 1 minute
- Headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
429 Too Many Requests
Next Steps: