Token Usage History
Free with bearer tokenGET /api/payment/usageThe /api/payment/usage endpoint returns your token's call history: the last 100 premium API calls aggregated by endpoint with per-endpoint counts and total credits spent, plus the 25 most recent entries. Powers the human-facing /account dashboard but useful for any agent monitoring its own spend.
When to use this endpoint
Anytime you need to audit per-endpoint usage for a token, monitor spend velocity, or render a usage dashboard.
Example response
{
"ok": true,
"token_balance": 47,
"total_calls": 3,
"total_credits_spent": 3,
"by_endpoint": {
"/api/premium/routing": { "calls": 2, "credits": 2, "last_seen": "2026-04-27T17:30:00Z" }
},
"recent": [
{ "endpoint": "/api/premium/routing", "credits": 1, "at": "2026-04-27T17:30:00Z" }
]
}Code samples
Python SDK
from tensorfeed import TensorFeed
tf = TensorFeed(token="tf_live_...")
usage = tf.usage()
for endpoint, info in usage["by_endpoint"].items():
print(f"{endpoint}: {info['calls']} calls, {info['credits']} credits")TypeScript SDK
import { TensorFeed } from 'tensorfeed';
const tf = new TensorFeed({ token: 'tf_live_...' });
const usage = await tf.usage();
console.log(`${usage.total_calls} calls, ${usage.total_credits_spent} credits`);MCP tool
Available via the TensorFeed MCP server as get_account_usage. Add npx -y @tensorfeed/mcp-server to your Claude Desktop or Claude Code MCP config.
FAQ
How far back does the usage history go?
The ring buffer holds the last 100 calls per token. Older calls roll off. For longer history, the daily site-wide rollup at /api/admin/usage is auth-gated and tracks per-endpoint volume across all tokens.
Is there a UI for the usage data?
Yes. /account is a noindex private dashboard where humans can paste their token to see balance + usage history. Token is stored in sessionStorage only, never localStorage.