API Token Authentication
The TensorPool API uses bearer token authentication. All API requests must include your API token in the Authorization header.Getting Your API Token
- Log in to your TensorPool Dashboard
- Generate or copy your API token
Keep your API token secure and never share it publicly. Treat it like a password.
Making Authenticated Requests
Include your API token in theAuthorization
header with the Bearer
scheme:
Python Example
JavaScript/Node.js Example
Testing Your Authentication
You can verify your API token is working by calling the/me
endpoint:
Token Security Best Practices
- Store tokens in environment variables, not in code
- Use different tokens for different environments (development, production)
- Rotate tokens periodically
- Revoke tokens immediately if compromised
Error Responses
If authentication fails, you’ll receive a401 Unauthorized
response:
401 Unauthorized
: Invalid or missing token403 Forbidden
: Valid token but insufficient permissions