POST
/api/video$0.10🎨 AI Video Generation
Generate short AI videos from text prompts using fal.ai video generation models. Ideal for creating dynamic visual content, animations, and short clips for social media or product demos.
Request Body
Response Fields
Code Examples
cURL
bash
curl -X POST https://sparkforge.sh/api/video \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-token>" \
-d '{
"prompt": "A golden sunset over ocean waves, cinematic",
"duration": 4
}'Python
python
import requests
response = requests.post(
"https://sparkforge.sh/api/video",
headers={"Content-Type": "application/json", "X-PAYMENT": "<token>"},
json={"prompt": "A golden sunset over ocean waves, cinematic", "duration": 4}
)
data = response.json()
print(data["video_url"])TypeScript / Node.js
typescript
const res = await fetch402("https://sparkforge.sh/api/video", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
prompt: "A golden sunset over ocean waves, cinematic",
duration: 4,
}),
});
const { video_url, duration } = await res.json();Example Response
json
{
"video_url": "https://fal.media/files/abc123/video.mp4",
"duration": 4
}💳 Payment via x402
This endpoint costs $0.10 per call, paid in USDC on Base, Polygon, or Solana. Use the @x402/fetch library to handle payments automatically, or implement the x402 handshake manually.
bash
# Free demo mode (no payment)
curl https://sparkforge.sh/api/video?demo=true
# Or try via MCP (Claude Desktop, Cursor, Windsurf)
# Add to mcp config: { "url": "https://sparkforge.sh/api/mcp" }