Skip to content

Video clip (4 seconds, fixed price)

$0.25 per callUSDC via x402POST /v1/videos/clip

Text-to-video (model-backed) over x402 at a fixed price: one silent 4-second 720p clip (MP4, inline base64) for $0.25, from Veo 3.1 Lite with Grok Imagine Video 1.5 Lite as the failover.

Category: LLM gatewayTags: video-generation video videos text-to-video generate generate-video create-video clip

Try in playground →

Details

Text-to-video (model-backed) over x402 at a fixed price: one silent 4-second 720p clip (MP4, inline base64) for $0.25, from Veo 3.1 Lite with Grok Imagine Video 1.5 Lite as the failover. aspect_ratio is 16:9 (default) or 9:16; 1:1, 4:3, 3:4, 3:2 and 2:3 come from the second model alone. For a longer clip or sound, priced per second, use /v1/videos/generations. The call returns when the clip is ready, up to 4 minutes. A failed or timed-out generation is not charged on x402 (a filtered one answers 422 with reason content_filtered), and a wallet payer whose request timed out can resend it unchanged to collect the same clip. Takes up to 4 minutes to answer: send the paid call with "Prefer: respond-async" to get a job link at once and collect the answer from it (on x402 the payment settles only on a delivered result), or with "Prefer: wait=240" and keep the connection open for at least 270 seconds, because a client that disconnects first loses the answer. A paid call with neither header is answered 400 before any payment is taken.

Parameters

NameTypeRequiredDescription
promptstringyesText description of the clip (up to 2,000 chars) Also accepted as text, input, description, q, query. Up to 2000 characters.
aspect_ratiostring (one of: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3)no16:9 (default, 1280x720) or 9:16 (720x1280); 1:1, 4:3, 3:4, 3:2 and 2:3 are made by the second model alone One of 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.

Example request

curl -i -X POST https://agent402.tools/v1/videos/clip \
  -H "Content-Type: application/json" \
  -d '{"prompt":"A paper boat drifting down a rain-soaked gutter, close up, cinematic","aspect_ratio":"16:9"}'

Watch a call get paid

RequestPOST /v1/videos/clip
402$0.25 USDC
SignPAYMENT-SIGNATURE
Settleon 11 chains
Answer200 OK
ReceiptAgent402-ReceiptEd25519

Example response

{
  "created": 1750000000,
  "model": "google/veo-3.1-lite",
  "data": [
    {
      "b64_json": "AAAAIGZ0eXBpc29t…",
      "media_type": "video/mp4",
      "duration_seconds": 4,
      "resolution": "720p",
      "aspect_ratio": "16:9",
      "audio": false
    }
  ],
  "usage": {
    "generation_seconds": 40
  }
}
FieldTypeAlways presentIn the example
creatednumberyes1750000000
modelstringyesgoogle/veo-3.1-lite
dataarray of objectsyes1 item in the example
usageobjectyes1 field: generation_seconds

From an MCP client

catalog.call {
  "slug": "v1-videos-clip",
  "params": {
    "prompt": "A paper boat drifting down a rain-soaked gutter, close up, cinematic",
    "aspect_ratio": "16:9"
  }
}

Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.21.0): pays from a wallet or AGENT402_CREDITS_KEY.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.25" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/v1/videos/clip", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "prompt": "A paper boat drifting down a rain-soaked gutter, close up, cinematic",
    "aspect_ratio": "16:9"
  }),
});

Get a wallet or run npx -y agent402-mcp@0.21.0 wallet new.

The quote (Python)

import base64, json, urllib.error, urllib.request

req = urllib.request.Request("https://agent402.tools/v1/videos/clip", method="POST", data="{\"prompt\":\"A paper boat drifting down a rain-soaked gutter, close up, cinematic\",\"aspect_ratio\":\"16:9\"}".encode(), headers={"Content-Type": "application/json"})
try:
    urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
    quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
    print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]])  # the price, per chain, in base units

Related tools