Token Balance
Free with bearer tokenGET /api/payment/balanceThe /api/payment/balance endpoint returns the current credit balance, total purchased, creation timestamp, and last-used timestamp for the bearer token. Useful for agents that want to monitor their own spend or top up before exhaustion.
When to use this endpoint
Periodically during a long-running agent session, or before initiating a high-credit-cost workload. Cheap to call (no credits charged).
Example response
{
"ok": true,
"balance": 49,
"created": "2026-04-27T15:00:00Z",
"last_used": "2026-04-27T17:30:00Z",
"total_purchased": 50
}Code samples
Python SDK
from tensorfeed import TensorFeed
tf = TensorFeed(token="tf_live_...")
print(tf.balance()) # {"balance": 49, ...}TypeScript SDK
import { TensorFeed } from 'tensorfeed';
const tf = new TensorFeed({ token: 'tf_live_...' });
const { balance } = await tf.balance();
if (balance < 5) { /* top up */ }MCP tool
Available via the TensorFeed MCP server as get_account_balance. Add npx -y @tensorfeed/mcp-server to your Claude Desktop or Claude Code MCP config.
FAQ
How do I check my balance without spending a credit?
Just call /api/payment/balance with your bearer token. The endpoint is free; no credits are decremented for the call.
Do credits expire?
No. Per the Terms of Service, credits do not expire. They remain spendable until consumed. Tokens are durable: store them like API keys.