Agent payments are rolling out gradually, and need an account on wallet billing. If
POST /v1/wallet/top-up answers 404 with FEATURE_NOT_AVAILABLE, they aren’t available for your account yet.How It Works
- Your agent asks TinyFish to top up, say $25.
- TinyFish answers with an HTTP
402payment challenge: the amount, the currency, and who to pay. - Your agent’s wallet issues a one-time Shared Payment Token (SPT) for that amount. Your card details never reach the agent or TinyFish.
- Your agent retries with the payment, Stripe charges it, and your wallet is credited in seconds, with a receipt.
stripe payment method works, including Stripe’s Link agent wallet.
REST API
Top-ups use your normal API key in theX-API-Key header. The payment travels in a separate Payment-Authorization header.
1
Ask for a top-up
402 Payment Required with the challenge in the WWW-Authenticate header:2
Pay the challenge
Hand the challenge to your MPP wallet. Once the payment is approved (some wallets, like Link, ask you first), it returns a payment credential (
Payment <base64url>). The challenge expires after 30 minutes, which leaves time for that approval.3
Retry with the payment
Send the same request again, with the same amount, plus the credential:
402 responses, such as Stripe’s Link agent wallet, run steps 2 and 3 for you.
Responses
A successful top-up looks like this:
Payment-Receipt header.
MCP
If your agent connects to the TinyFish MCP server athttps://agent.tinyfish.ai/mcp (see MCP Integration), it gets a top_up_wallet tool. It needs no API key: it tops up the wallet of the account you signed in with.
The tool takes two calls:
- Call
top_up_walletwith anamount, like"25.00". It returnspayment_requiredand the challenge. - Pay the challenge, then call
top_up_walletagain with the same amount and either:payment_credential: the credential from your MPP wallet, orsptpluschallenge: a Stripe Shared Payment Token issued for the challenge, and the challenge itself.
status is settled, pending (paid, credit landing, don’t pay again), or unconfirmed (don’t pay again on your own).
top_up_wallet is available on the main MCP server. The ChatGPT and Claude directory apps don’t include it.Never Paying Twice
TinyFish is built so one top-up is charged once:- A replayed payment is never charged again. Sending the same credential twice credits the wallet once.
- A failed paid retry never gets a new challenge. Some failures can happen after a charge, for example a timeout while Stripe is processing. So TinyFish answers
402without a challenge, and an MPP wallet has nothing to pay automatically. - A charge that went through is credited automatically, even if something fails right after it.
402 without a challenge, a 202, or a request that errors or times out after it sent a payment, it shouldn’t start a new top-up on its own. If the balance hasn’t increased after 10 minutes, it should ask you first.
Refunds
For a refund of an agent top-up, contact support with thepayment_reference from the response.