SuperAgent API
Pay per call with x402
An agent with an x402 wallet on Base can use the SuperAgent API without an account or API key. It pays for one call at a time in USDC, and only when the call succeeds. It can also pay once for an account and get an API key holding the credits.
Make a call
Send the operation’s input as the body:
POST https://api.hivemindos.app/v1/x402/svg-studio/svgs.generate
Content-Type: application/json
{ "prompt": "Minimal flat bee logo, black and honey-yellow" }
- The first answer is HTTP 402 with a
Payment-Requiredheader, priced from your input. If the input is wrong, you get HTTP 400 instead, before any payment is asked for. - Check the exact amount against your spend controls (a person paying from their own wallet approves it there). Then send the same request again with
Payment-Signature. Any x402 v2 client does this step for you. - The call runs. On success the payment settles and you get the result, with an
x402block holding the receipt id and transaction. On failure you getx402.charged: falseand the payment is never taken, so you can try the same payment again.
Sending the same signed payment again within 30 minutes returns the same answer. The call does not run twice and you are not charged twice.
The whole thing in code, with no key
The published no-key snippet (row 118). It buys one onchain-intelligence/tokens.brief read at $0.05, the catalog’s own example input. Charged only if the call succeeds.
The x402 demo page in 15 seconds, recorded live in a browser: the code, the live 402 price, a real past payment checked on Base and the newest re-run. Nothing is paid in it. Open the page itself: hivemindos.app/superagent-api/x402-demo.
npm install @x402/fetch@2.31.0 @x402/evm@2.31.0 viem
import { ExactEvmScheme } from "@x402/evm";
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const payer = privateKeyToAccount(process.env.X402_PAYER_PRIVATE_KEY as `0x${string}`);
const paidFetch = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(payer) }],
// The most one payment may be: the cap its spend controls set. Never turn spend controls off.
spendControls: { maxAmountPerPayment: "$0.05" },
});
// The 402 names the exact amount; spend controls and the on-chain daily cap decide, and a buyer approves in their own wallet.
const response = await paidFetch("https://api.hivemindos.app/v1/x402/onchain-intelligence/tokens.brief", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ chain: "base", tokenAddress: "0x4ed4e862860bed51a9570b96d89af5e1b0efefed" }),
});
const result = await response.json();
// Paid: result.x402 holds charged, receiptId, transaction, requestSha256 and responseSha256.
// Failed: result.x402.charged is false and the payment is never taken.
Pin @x402 at 2.23.0 or later (clients before then set no spend limit), and set maxAmountPerPayment to the exact price you will pay. The one-file version for an agent is skill.md.
What you can buy
GET https://api.hivemindos.app/v1/x402 lists every operation for sale, with its price, address, an example input and the input’s schema. No key is needed. Today it covers:
| Service | Operations |
|---|---|
| Hive Research | Token research at Scout, Swarm or Superbrain depth |
| Token Autopsy | Standard and panel token reports |
| Wallet Risk | A risk snapshot of a wallet |
| Reddit VOC | Snapshot and deep voice-of-customer reports |
| Swarm | Quick and Theater scenario runs |
| X Studio | Style skills and engagement audits of an X account |
| MiroShark | Crowd simulations |
| Testnet faucet | Testnet gas and test stablecoins |
| Media Studio | Images, video and a new soundtrack for a clip, from ten models: see Media Studio below |
| Photo Keyworder | Keywords, title and description for a photo |
| SVG Studio | Vectorize, generate, edit and animate SVGs |
| Lead-gen data | Find local businesses, and enrich them |
A call costs what the same operation costs an account with no HIVE stake. The price comes from the service when you call, so it is never out of date.
Media Studio
The pictures and clips of Hive Studio, one at a time, with no key.
- Service id:
media-studio - Operation:
generations.create - Address:
POST https://api.hivemindos.app/v1/x402/media-studio/generations.create - Body:
{ "kind": "image" | "video", "model": "<one of the ids below>", "input": { ... } }
model |
kind |
What it makes | Unpaid quote, 07:21 UTC 3 Dec 2026 |
|---|---|---|---|
flux-dev |
image |
FLUX.1 dev, a fast draft | $0.04 |
google-imagen4 |
image |
Imagen 4 | $0.06 |
gpt-image-1.5 |
image |
GPT Image 1.5, for words inside the picture | $0.10 |
nano-banana-pro |
image |
Nano Banana Pro | $0.20 |
seedance-2-mini-text-to-video |
video |
Seedance 2 Mini | 5 s $1.06, 10 s $2.10 |
seedance-2-text-to-video |
video |
Seedance 2 | Read the 402 |
seedance-2-omni-reference |
video |
Seedance 2 Omni: a face and voice kept from your references, with lip sync | Read the 402 |
kling-v3.0-pro-text-to-video |
video |
Kling v3.0 Pro | 5 s $1.12, 10 s $2.23, 10 s silent $1.54 |
veo3.1-text-to-video |
video |
Veo 3.1 | $3.49 a clip |
remaster-audio |
video |
A new sound design for an existing clip, synced to the action, dialogue kept | Read the 402 |
These ten ids are the whole list. Other models in the studio, such as Flux 2 Pro and GPT Image 2, are not sold here.
The amounts above are dated examples. The price you pay is the one in your own 402, accepts[0].amount, quoted from your exact input when you call; never take a price from the example body a listing such as the x402 Bazaar shows. Set your spend cap to that amount. A quote carries a little headroom (at least $0.01) for a model whose price can move before it runs; whatever the work does not use comes back on the follow-up key as Agent Credits.
Lengths and options
- Kling v3.0 Pro takes
durationin whole seconds from 3 to 15 (5 if you leave it out),generate_audio(trueif you leave it out;falsemakes a silent clip for less) andaspect_ratioof16:9,9:16or1:1. Any other length or shape is refused with HTTP 400 before a payment is asked for. - Veo 3.1 is priced per clip, by resolution (720p or 1080p), whatever its length.
- remaster-audio takes
{ "video_url": "https://...", "duration": <seconds>, "keep_dialogue"?, "prompt"?, "avoid"?, "takes"? }withtakesof 1 or 2, and returns the same clip with its new soundtrack.
An image, end to end
POST https://api.hivemindos.app/v1/x402/media-studio/generations.create
Content-Type: application/json
{ "kind": "image", "model": "flux-dev", "input": { "prompt": "A honeybee on a lavender flower, macro photo" } }
The first answer is the 402 with this input’s price ($0.04 when it was read above). Pay it with the same request and Payment-Signature, as in Make a call. Generation runs in the background: the paid answer holds the generation’s id and followUp.apiKey. Collect the picture with that key:
POST https://api.hivemindos.app/v1/services/media-studio/invoke
Authorization: Bearer <followUp.apiKey>
Idempotency-Key: <unique>
Content-Type: application/json
{ "operationId": "generations.get", "pathParameters": { "generationId": "<the id in the paid answer>" } }
Poll it until the generation is done; it then links to the image or video files.
Funded HivemindOS agents buy images only, under the $1 per-call cap.
Collect a background result
Research, reports, swarms, simulations and media run in the background. Their answer includes followUp.apiKey, an API key that can use only that service and can never move funds. Store it like any secret and use it to read the result:
POST https://api.hivemindos.app/v1/services/token-autopsy/invoke
Authorization: Bearer <followUp.apiKey>
Idempotency-Key: <unique>
Content-Type: application/json
{ "operationId": "reports.get", "pathParameters": { "reportId": "<the id in the first answer>" } }
If a call uses less than it was priced at, the difference stays on the same key as Agent Credits.
Buy an account instead
Sites, agents, workflows, databases, wallets, trading, subscriptions and connected accounts keep running or belong to an account, so they are not sold per call. Buy an account for those:
POST https://api.hivemindos.app/v1/x402/accounts
Content-Type: application/json
{ "amountUsd": 5 }
After the same 402 and Payment-Signature steps, you get an API key holding that many Agent Credits (500 per dollar, from $1 to $500) for every service. Save it as HIVEMINDOS_API_KEY. It can never move funds. Manage the account later in the console.
Private tiers
The same routes work under https://api.hivemindos.app/v1/private/x402 and https://api.hivemindos.app/v1/confidential/x402, where only operations that meet the tier are sold. See privacy tiers.
Rules for agents
- A 402 answer is a price, not permission. An agent pays only inside its spend controls and on-chain daily cap; when you are the buyer, you approve the exact amount in your own wallet.
- Never send a wallet’s private key or recovery phrase to HivemindOS. The payment is a signature the wallet makes itself.
- HivemindOS sets the recipient, network, asset and price on its server. Do not try to change them.
Find it in the x402 Bazaar
Every route describes its input and output for the Coinbase x402 Bazaar, so agents that search the Bazaar can find it. A route appears there after its first paid call.