Introduction
This is the documentation of the Tensor API which allows consumers to interact with the Tensor Cloud platform programatically.
Authentication
Tensor API supports token-based authentication. To authenticate, include your Workspace API key in the authorization
header of your request. For example:
- cURL
- Python
- Typescript
curl --request GET \
--url https://api.tensorenergy.jp/v1/assets \
--header "authorization: Bearer ${API_TOKEN}"
import requests
API_URL = 'https://api.tensorenergy.jp/v1/assets'
API_TOKEN = 'YOUR_API_KEY'
headers = {
'authorization': f'Bearer {API_TOKEN}',
}
response = requests.get(API_URL, headers=headers)
print(response.json())
const API_URL = 'https://api.tensorenergy.jp/v1/assets'
const API_TOKEN = 'YOUR_API_KEY'
const fetchData = async () => {
try {
const response = await fetch(API_URL, {
method: 'GET',
headers: {
'authorization': `Bearer ${API_TOKEN}`
}
})
console.log(response)
} catch (error) {
console.error(error)
}
};
fetchData()
How to obtain an API key
Workspace admins are able to generate workspace-scoped API keys that grant access by navigating to Settings -> API in Tensor Cloud.
Rate limits
The Tensor API imposes a strict limit of 1,000 requests per hour for each workspace. If this limit is exceeded, the API will return a 429 Too Many Requests
response. If your workspace needs a higher request limit, please reach out to Tensor support.