Documentation

Video generation with SingIt

Owner-set spending limits are the point: on Base, the AgentAllowance contract enforces your agent's daily, per-purchase and expiry limits onchain. Revoke any time; Emergency stop pauses spending on Base. On Solana, the SingIt server checks the daily and per-purchase limits; only the total is onchain via the SPL delegate. Revoke any time. Emergency stop exists on Base only. These allowance checks apply to API-key payments, which do not yet support async video jobs; a call you pay from your own wallet is limited by what you sign.

Text in, a finished video clip out. Video generation accepts USDC on Base (x402 exact) and Solana (x402 upto, so your client must support the upto scheme), with no account or API key. The max charge is quoted before signing; you pay only for a finished clip. A disabled route returns 503 video_disabled.

A paid request answers 202 with job_id and status_url; poll it and download with the X-Job-Token when ready. On Base the signature is verified when the job is created and settled only after the clip is ready, and a failed job charges nothing. On Solana the quoted maximum is held in an x402 escrow, the clip price is settled when the clip is ready, and if rendering fails or times out the escrow returns the funds to the buyer.

Routes

CallWhat it doesPrice
GET /v1/video/modelsSold models, durations, expected render time and per-network pricesFree
POST /v1/video/generationsStart a clip job; 202 with job_id, status_url, poll_after_seconds and job_token0.261 USDC (Base) / 0.262 (Solana) for grok-imagine-text-to-video; 0.326 / 0.327 for longcat-text-to-video; inspect the 402 before signing
GET /v1/video/generations/{id}Job status, with X-Job-TokenFree
GET /v1/video/generations/{id}/content?index=0Download the clip with X-Job-TokenFree

All routes use https://ask.singitai.app. See models and live prices.

Sold now: Grok Imagine 5-second clips (about 100 seconds to render) and LongCat 8-second clips (about 290 seconds). Wan, Seedance, Kling, LTX and Veo are listed as excluded until their render time is measured inside the payment window.

The request requires model and prompt (up to 2000 characters). Optional fields: duration_seconds (the sold length), resolution, aspect_ratio (such as 16:9), audio and fallback. By default, a failed model may be replaced by a compatible healthy model priced no higher than the signed quote. Set fallback:false to refuse substitution.

Payment windows

NetworkSchemeWhat you signWhen you are charged
BaseexactThe clip price, valid 600 secondsSettled only for a finished clip, before validBefore minus 30 seconds
SolanauptoAn escrow for the clip price plus 0.000001 USDC, open 600 secondsThe clip price is claimed for a finished clip, before the escrow's expiry minus 60 seconds; the rest returns to you

On Solana a failed, empty or late job, or one interrupted by a service restart, settles zero: the escrow returns the whole deposit. SingIt never sends a refund from its own wallet; the escrow program returns the funds. If that refund cannot be sent before the escrow expires, the escrow still returns the deposit by protocol after expiry.

Inspect the 402 with curl

# Free model and price lookup
curl -s https://ask.singitai.app/v1/video/models

# Free unpaid request: inspect PAYMENT-REQUIRED in the 402 response
curl -si -X POST https://ask.singitai.app/v1/video/generations \
  -H 'Content-Type: application/json' \
  -d '{"model":"grok-imagine-text-to-video","prompt":"a small green robot waves hello","duration_seconds":5}'

Decode PAYMENT-REQUIRED as base64 JSON. It offers Base exact and Solana upto. Check the network, token, recipient and amount against your budget, sign one offer with a 202-aware x402 client, then retry the same body with PAYMENT-SIGNATURE. The curl commands above do not sign or pay.

Poll, then download for free

// `signed` is the PAYMENT-SIGNATURE your x402 client produced for one offer.
const res = await fetch("https://ask.singitai.app/v1/video/generations", {
  method: "POST", headers: { "Content-Type": "application/json", "PAYMENT-SIGNATURE": signed },
  body: JSON.stringify({ model: "grok-imagine-text-to-video",
    prompt: "a small green robot waves hello", duration_seconds: 5 }),
});
if (res.status !== 202) throw new Error(`Video request returned ${res.status}`);
const job = await res.json();
const headers = { "X-Job-Token": job.job_token };
let state;
do {
  await new Promise(r => setTimeout(r, job.poll_after_seconds * 1000));
  state = await (await fetch(`https://ask.singitai.app${job.status_url}`, { headers })).json();
} while (["queued", "running", "settling", "refunding"].includes(state.status));
if (state.status !== "succeeded") throw new Error(state.error?.message);
const clip = await fetch(`https://ask.singitai.app${state.video_url}`, { headers }); // video/mp4 bytes

The high-level SingIt SDK paidFetch expects a synchronous 200 and does not yet return the 202 job body, so use a 202-aware x402 signer. Disable framework retries so they cannot sign another payment automatically. Keep the job token private.

Only succeeded, with video_url, files and a receipt, means you were charged. failed says how: on Base nothing was settled; on Solana refund shows the zero-amount escrow settlement. A bad request returns 400; an unknown model returns 400 model_not_found; a reused payment returns 409. A job lost to a service restart answers 404 and is never charged. After a dropped connection or settlement_unknown, reconcile the original payment before signing another one.

MCP - coming with the next MCP release

{"name":"generate_video","arguments":{"model":"grok-imagine-text-to-video","prompt":"a small green robot waves hello","duration_seconds":5}}

This is a planned tool, not available today. Use the x402 route above. Existing read-only MCP companions are get_allowance before spending and get_receipts after. API-key video payments are not yet supported for async jobs.

Limits and receipts

Every charged clip carries PAYMENT-RESPONSE and X-SingIt-Receipt on its succeeded status. Send X-SingIt-Limiter with the unpaid request to see whether the Base offer fits your allowance; the Solana offer is marked not checked. Payments from your own wallet are limited by what you sign. Base allowance limits are enforced by AgentAllowance. Revoke any time; Emergency stop pauses the Base allowance.