Autonomous agents can purchase video clips as part of a multi-step pipeline without a human handing over a credit card or OAuth token. The x402 protocol lets an agent hold a USDC wallet, see the exact price in the 402 challenge, decide to pay, and sign atomically — all in code. This is a unique capability of the x402 protocol not available with traditional API-key services.
Example prompt (agent-composed, part of a travel itinerary pipeline)
"smooth aerial reveal of Santorini whitewashed village at golden hour, camera slowly rising to show the caldera and sea, 8 seconds, dreamy travel vibe"
POST /generate/seedance-fast/5s-720p
~$0.45 / call
TYPESCRIPT (agent wallet — x402 autonomous payment)
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme, toClientEvmSigner } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
// Agent holds its own wallet — no human OAuth needed
const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const fetchPay = wrapFetchWithPayment(fetch,
new x402Client().register("eip155:*",
new ExactEvmScheme(toClientEvmSigner(account))));
// 402 challenge -> agent inspects price -> signs USDC payment -> video
const res = await fetchPay(
"https://api.x402-video.com/generate/seedance-fast/5s-720p",
{ method: "POST", headers: { "Content-Type": "application/json" },
body: JSON.stringify({ prompt: "smooth aerial reveal of Santorini whitewashed village at golden hour..." }) }
);
const { job_id } = await res.json();