Get a token
Get the token that every request to Total API needs, and check its credits.
On this page
Every request to Total API needs your token. The token identifies you, and each request takes its price from the credits of the token.
Get it
- Open the Total.js Platform and sign in with your Total.js account.
- Open the API section. It shows your token, your credits and the current price of each service.
- Copy the token.
Keep the token secret, like a password: anyone who has it can spend its credits. Put it in the configuration of your application, never in code that a browser downloads.
Check the credits
The check service returns the credits that remain. It is free.
var response = await API('TAPI', 'check').promise();
console.log(response.credits);