/** * Video Generation capability — generate short MP4 videos via the BlockRun * /v1/videos/generations endpoint. Uses x402 payment (Base or Solana). * * Default model `xai/grok-imagine-video` returns an 8-second clip for ~$0.42 * (480p at $0.05/s; the gateway added an official 720p tier at $0.07/s on * 2026-08-12). Seedance (bytedance/seedance-2.0-mini through -2.5) runs * longer — up to a few minutes for a 10s clip. * * Flow (async since blockrun@654cd35): * 1. POST /v1/videos/generations with signed x-payment header. The server * verifies payment (does NOT settle), submits the upstream job, and * returns 202 { id, poll_url, status: "queued" }. * 2. GET the poll_url with the SAME x-payment header every ~5s until * status=completed. On the first completed poll the server backs up * the MP4 to GCS, settles payment, and returns the video URL. * 3. Download the MP4 and write it locally. * * If the upstream job fails, the server returns status=failed and no USDC * is ever transferred. If the client never polls, no charge either. */ import type { CapabilityHandler } from '../agent/types.js'; import type { ContentLibrary } from '../content/library.js'; import { type GatewayModel } from '../gateway-models.js'; export interface VideoGenDeps { library?: ContentLibrary; onContentChange?: () => void | Promise; } /** * Resolve the per-clip USD cost used for the spend confirm, budget check, usage * stats, AND the content-budget asset record — one value so they can never * disagree. The flat $0.05/s estimate is the fallback for an unknown model, but * a catalog-priced per-second model (e.g. Seedance at $0.15/s) costs far more, * so take the HIGHER of the catalog price and the (margin-adjusted) flat * estimate. Without this the budget check + asset record undercount the cap ~3x * for Seedance. Mirrors ImageGen's resolveImageUnitCost. Exported for tests. */ export declare function resolveVideoUnitCost(catalogModel: GatewayModel | null, durationSeconds: number): number; export declare function createVideoGenCapability(deps?: VideoGenDeps): CapabilityHandler; export declare const videoGenCapability: CapabilityHandler;