Documentation Index
Fetch the complete documentation index at: https://docs.sawmills.ai/llms.txt
Use this file to discover all available pages before exploring further.
API Key Commands
Create API Key
JWT Token: Get
YOUR_JWT_TOKEN from Chrome DevTools → Network tab → Find API request → Copy Authorization header value (after “Bearer ”).List API Keys
Revoke API Key
Token Commands
Exchange API Key for Token
Use Token for API Call
Authentication Headers
| Purpose | Header Format | Example |
|---|---|---|
| Create/Manage API Keys | Authorization: Bearer {jwt} | Authorization: Bearer eyJhbGciOiJSUzI1NiIs... |
| Exchange for Token | Authorization: ApiKey {key} | Authorization: ApiKey sk_test.abc123def4.xyz789uvw0123456789abcdef |
| Make API Calls | Authorization: Bearer {token} | Authorization: Bearer eyJhbGciOiJSUzI1NiIs... |
Common Error Codes
| Code | Meaning | Solution |
|---|---|---|
UNAUTHENTICATED | Invalid credentials | Check API key/token validity |
PERMISSION_DENIED | Insufficient permissions | Verify scopes |
NOT_FOUND | Resource not found | Check if key exists |
INVALID_ARGUMENT | Bad request | Validate parameters |
Environment Variables
Testing Authentication
Test API Key
Test Token Exchange
Test API Call
Troubleshooting Checklist
- API key is correctly formatted
- API key is active and not revoked
- Authorization header uses correct scheme (
ApiKeyvsBearer) - Token hasn’t expired (30 minutes default)
- HTTPS is being used
- No extra whitespace in credentials
- Correct environment (test vs live)