Video generation (4-second clip)

$0.200 per call · USDC via x402 · POST /v1/videos/generations

Text-to-video over x402 - one silent 4-second 720p clip (MP4, inline base64) for a flat $0.20, served by Veo 3.1 Lite. Send POST /v1/videos/generations with the required field prompt and pay $0.200 per call over x402 with USDC on an EVM chain. It returns a JSON object with created, model, data and usage.

Choose aspect_ratio 16:9 (default) or 9:16; duration, resolution and audio are fixed so the price is. The call returns when the clip is ready (about 40 seconds measured, up to 4 minutes); a failed or timed-out generation is never charged.

Category: LLM gateway · Tags: video-generation video videos text-to-video generate generate-video create-video clip

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
promptstringyesText description of the clip (up to 2,000 chars) Also accepted as text, input, description, q, query.
aspect_ratiostring (one of: 16:9, 9:16)no16:9 (default, 1280x720) or 9:16 (720x1280)

Example request

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

Without payment this returns HTTP 402 Payment Required with the exact price for v1-videos; any x402 v2 or MPP client pays it and retries.

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"
    }
  ],
  "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",
  "params": {
    "prompt": "A paper boat drifting down a rain-soaked gutter, close up, cinematic",
    "aspect_ratio": "16:9"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for v1-videos; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

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?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/v1/videos/generations", {
  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"
  }),
});

Related tools

Fast image generation (OpenAI-compatible, budget)

$0.020 · POST /v1/images/fast

Budget text-to-image over x402 - OpenAI images wire (prompt in, inline base64 out) at $0.02 per picture, a quarter of th…

Pro image generation (OpenAI-compatible)

$0.050 · POST /v1/images/pro

Higher-fidelity text-to-image over x402 - OpenAI images wire (prompt in, inline base64 out) at $0.05 per picture. Served…

Text-to-speech (OpenAI-compatible)

$0.060 · POST /v1/audio/speech

OpenAI-compatible text-to-speech over x402 - point any OpenAI SDK's audio.speech.create() at base_url https://agent402.t…

Chat completions (OpenAI-compatible)

$0.02 · POST /v1/chat/completions

OpenAI-compatible chat completions, base tier: point any OpenAI SDK at base_url https://agent402.tools/v1 and pay per ca…

Chat completions - auto tier (eval-ranked routing)

$0.01 · POST /v1/auto/chat/completions

OpenAI-compatible chat completions with server-side model choice: omit "model" (or send "auto") and the gateway routes t…

Responses auto (OpenAI Responses API)

$0.01 · POST /v1/auto/responses

OpenAI Responses API over x402 - point the OpenAI SDK's responses.create() (or the OpenAI Agents SDK) at base_url https:…