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 the Authorization header with the Bearer scheme:
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://engine.tensorpool.dev/me
Python Example
import requests
API_TOKEN = "your_api_token_here"
BASE_URL = "https://engine.tensorpool.dev"
headers = {
"Authorization": f"Bearer {API_TOKEN}"
}
response = requests.get(f"{BASE_URL}/me", headers=headers)
data = response.json()
JavaScript/Node.js Example
const API_TOKEN = 'your_api_token_here';
const BASE_URL = 'https://engine.tensorpool.dev';
const headers = {
'Authorization': `Bearer ${API_TOKEN}`
};
fetch(`${BASE_URL}/me`, { headers })
.then(response => response.json())
.then(data => console.log(data));
Testing Your Authentication
You can verify your API token is working by calling the /me endpoint:
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://engine.tensorpool.dev/me
A successful response will return your account information.
Error Responses
If authentication fails, you’ll receive a 401 Unauthorized response:
{
"error": "Invalid or missing authentication token"
}
Common authentication errors:
401 Unauthorized: Invalid or missing token
403 Forbidden: Valid token but insufficient permissions