LIVE
ANTHROPICOpus 4.7 benchmarks published2m ago
CLAUDEOK142ms
OPUS 4.7$15 / $75per Mtok
CHATGPTOK89ms
HACKERNEWSWhy has not AI improved design quality the way it improved dev speed?14m ago
MMLU-PROleader Opus 4.788.4
GEMINIDEGRADED312ms
MISTRALMistral Medium 3 released6m ago
GPT-4o$5 / $15per Mtok
ARXIVCompositional reasoning in LRMs22m ago
BEDROCKOK178ms
GEMINI 2.5$3.50 / $10.50per Mtok
THE VERGEFrontier Model Forum expansion announced38m ago
SWE-BENCHleader Claude Opus 4.772.1%
MISTRALOK104ms
ANTHROPICOpus 4.7 benchmarks published2m ago
CLAUDEOK142ms
OPUS 4.7$15 / $75per Mtok
CHATGPTOK89ms
HACKERNEWSWhy has not AI improved design quality the way it improved dev speed?14m ago
MMLU-PROleader Opus 4.788.4
GEMINIDEGRADED312ms
MISTRALMistral Medium 3 released6m ago
GPT-4o$5 / $15per Mtok
ARXIVCompositional reasoning in LRMs22m ago
BEDROCKOK178ms
GEMINI 2.5$3.50 / $10.50per Mtok
THE VERGEFrontier Model Forum expansion announced38m ago
SWE-BENCHleader Claude Opus 4.772.1%
MISTRALOK104ms
All endpoints

Buy Credits

Free
POST /api/payment/buy-credits

POST to this endpoint with an amount_usd to receive a payment quote: the wallet address to send USDC to, a memo (optional but recommended), the credit amount you will receive, and a 30-minute expiry. Send the USDC, then call /api/payment/confirm with the tx_hash and memo.

When to use this endpoint

Step 1 of the credits-first payment flow. Use this for any agent that will make repeat premium calls; the latency cost is paid once on the credits purchase rather than per-call.

Parameters

NameInTypeDescription
amount_usd*bodynumberUSD value to purchase. Min 0.5, max 10000. Volume discounts at $5 (10%), $30 (25%), $200 (40%).

* required

Example response

{
  "ok": true,
  "wallet": "0x549c82e6bfc54bdae9a2073744cbc2af5d1fc6d1",
  "memo": "tf-eb13b1a17c6811d6",
  "amount_usd": 1.0,
  "credits": 50,
  "currency": "USDC",
  "network": "base",
  "expires_at": "2026-04-27T18:30:00Z",
  "ttl_seconds": 1800,
  "next_step": "Send 1.0 USDC on Base to 0x549..., then POST /api/payment/confirm with tx_hash and memo."
}

Code samples

Python SDK

from tensorfeed import TensorFeed

tf = TensorFeed()
quote = tf.buy_credits(amount_usd=1.0)
print(f"Send {quote['amount_usd']} USDC to {quote['wallet']}")
print(f"Memo: {quote['memo']}")

TypeScript SDK

import { TensorFeed } from 'tensorfeed';

const tf = new TensorFeed();
const quote = await tf.buyCredits({ amountUsd: 1.0 });
console.log(`Send ${quote.amount_usd} USDC to ${quote.wallet}`);

FAQ

How much USDC should I send?

Send exactly the amount_usd from the quote. The on-chain verification compares the received amount against the quoted amount within $0.01; if it matches, you get the quoted credits including any volume discount. If you send more or less, credits are calculated from the actual amount at the base rate.

How long is the quote valid?

30 minutes. After expiry, the quote is unusable and you must request a new one. The /api/payment/confirm call without a nonce uses the actual tx amount at base rate, so a refresh is rarely necessary.

Related endpoints