The endpoint
POST https://app.secretwolf.io/api/x402/secrets
Anonymous and pay-per-use. The agent sends the secret; the response is a single-view link
(https://get.secretwolf.io/s/…) to hand to its human. The payload is AES-256-GCM
encrypted, revealed exactly once, then hard-deleted — the API never returns or logs the plaintext.
How payment works (x402)
x402 revives HTTP 402 Payment Required. It's one request and a retry: the endpoint
answers 402 with the price; the agent's x402 client signs a
USDC payment on Base and retries; a facilitator settles it and
the endpoint returns 200 with the link. Any x402-capable client handles the handshake —
the agent just needs a funded wallet.
curl -i -X POST https://app.secretwolf.io/api/x402/secrets \
-H "content-type: application/json" \
-d '{"text":"AKIA...the secret value..."}'
# -> 402 Payment Required. An x402 client signs a $0.10 USDC payment and retries.
On success:
{
"url": "https://get.secretwolf.io/s/8Kf3PunwGEt7hELi…",
"id": "8Kf3PunwGEt7hELi…"
}
Protocol details
The endpoint speaks x402 version 2. The challenge
arrives base64-encoded in a PAYMENT-REQUIRED response header; your client returns its
signed authorisation in PAYMENT-SIGNATURE and gets a settlement receipt back in
PAYMENT-RESPONSE. The legacy v1 header name X-PAYMENT is still accepted,
so an older client isn't locked out.
- Scheme —
exact. - Network —
eip155:8453, which is Base mainnet in CAIP-2 form. - Asset — USDC, at $0.10 per secret. Read
assetandpayTofrom the live challenge rather than pinning them. - Identity, optional — if your agent implements Web Bot Auth, send a
Signature-Agentheader carrying the absolutehttpsURL of your HTTP Message Signatures key directory. We record it against the payment so a repeat caller stays recognisable across wallet addresses. It costs nothing, changes nothing and gates nothing — we don't verify the signature, so it's a label rather than a credential.
A malformed request is rejected with 400 before any payment is taken, so an agent is
never charged for a call that couldn't have produced a secret.
Example (TypeScript, x402-fetch)
import { wrapFetchWithPayment } from "x402-fetch";
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";
// A wallet funded with USDC on Base (the agent controls it).
const pay = wrapFetchWithPayment(fetch, createWalletClient({ account, chain: base, transport: http() }));
const res = await pay("https://app.secretwolf.io/api/x402/secrets", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ templateKey: "api-key", fields: { key: newApiKey } }),
});
const { url } = await res.json(); // hand this one-time link to the human
Send free text, or a typed template
(website-login, dns-account, api-key, custom) via
templateKey + fields. Text/template only, always one-time-use. A malformed
request is rejected before any payment is taken.
Agent-to-agent
The recipient can be another agent, not just a human. Instead of the web page, it consumes the secret
over JSON — POST /api/x402/secrets/{id}/reveal returns the value exactly once
(free; the 256-bit link is the capability), then it's destroyed and audited. So one agent can
provision a credential and hand it straight to another, single-use.
Discovery
The endpoint publishes x402 discovery metadata (service SecretWolf, tags
secret, one-time, credentials) so x402-native agents can find
it, and it's described for LLMs at /llms.txt. Full request/response reference
is in the API docs.
Machine-readable: OpenAPI 3.1 for both endpoints, with request and response schemas. Point a client generator or an agent framework straight at it.