Documentation Index
Fetch the complete documentation index at: https://docs.in10nt.ai/llms.txt
Use this file to discover all available pages before exploring further.
Track token usage and costs
Documentation Index
Fetch the complete documentation index at: https://docs.in10nt.ai/llms.txt
Use this file to discover all available pages before exploring further.
const client = new In10ntClient();
const usage = await client.usage.getTokenUsage();
console.log(`Monthly: ${usage.monthlyTokens} tokens, $${usage.monthlyCost}`);
console.log(`Total: ${usage.totalTokens} tokens, $${usage.totalCost}`);
{
monthlyTokens: 1250000,
monthlyCost: 15.75,
totalTokens: 5000000,
totalCost: 63.00,
lastUsage: "2025-01-06T..."
}
const result = await instance.run('Build a REST API');
console.log(`Tokens: ${result.tokensUsed}`);
console.log(`Duration: ${result.duration_ms}ms`);
const instance = await Instance.create({
name: 'tracker',
description: 'Task tracker'
});
let sessionTokens = 0;
const r1 = await instance.run('Task 1');
sessionTokens += r1.tokensUsed;
const r2 = await instance.run('Task 2');
sessionTokens += r2.tokensUsed;
console.log(`Session: ${sessionTokens} tokens`);
// Check monthly
const client = new In10ntClient();
const usage = await client.usage.getTokenUsage();
console.log(`Monthly: ${usage.monthlyTokens} tokens`);
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://in10t-api-v2.fly.dev/usage/tokens