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

Confirm Payment

Free
POST /api/payment/confirm

POST to this endpoint with the tx_hash of your USDC transfer on Base. The Worker reads the transaction receipt from the Base RPC, verifies the recipient and amount, and returns a tf_live_ bearer token tied to your credits. Replay protection is enforced: each tx hash can mint credits exactly once.

When to use this endpoint

Step 2 of the credits-first payment flow, after the USDC has confirmed on Base. Typically called within 30 minutes of /api/payment/buy-credits with the same memo for volume-discount accuracy.

Parameters

NameInTypeDescription
tx_hash*bodystring0x-prefixed Base mainnet transaction hash
noncebodystringOptional memo from buy-credits to apply volume discount

* required

Example response

{
  "ok": true,
  "token": "tf_live_eb0d0155...",
  "credits": 50,
  "balance": 50,
  "tx_amount_usd": 1.0,
  "rate": "base"
}

Code samples

Python SDK

from tensorfeed import TensorFeed

tf = TensorFeed()
result = tf.confirm(tx_hash="0x13bc...", nonce="tf-eb13b1a17c6811d6")
# Token is auto-stored on tf
rec = tf.routing(task="code")

TypeScript SDK

import { TensorFeed } from 'tensorfeed';

const tf = new TensorFeed();
const result = await tf.confirm({ txHash: '0x13bc...', nonce: 'tf-...' });
// tf.token is auto-set
const rec = await tf.routing({ task: 'code' });

FAQ

How long does on-chain verification take?

The Worker calls eth_getTransactionReceipt on a Base mainnet RPC. Once the tx is confirmed (a few seconds after broadcast), verification completes in 200-500ms. We verify the USDC Transfer event log, recipient address, and amount before minting credits.

What if I submit the same tx_hash twice?

Rejected. Replay protection is permanent: every used tx hash is recorded under pay:tx:{txHash} in our KV store with no TTL. The second confirm call returns ok: false with reason: tx_already_claimed.

Related endpoints