API reference

Frameza API

Two endpoints: submit a job, then poll it. Jobs run on Fal.ai’s queue, so long video renders never hold a connection open.

Authentication: create an API key on your account page and send it as Authorization: Bearer fz_live_…. Keys can render, upload and read your history, charged to your account’s credits. Keep them server-side — never ship one in browser or mobile code.

1 · Submit a generation

POST /api/generate with a model id, a prompt and an optional aspect ratio. Returns 202 with a job id.

export FRAMEZA_API_KEY=fz_live_…

curl -X POST https://frameza.ai/api/generate \
  -H "Authorization: Bearer $FRAMEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "flux-dev", "prompt": "a red fox in fresh snow", "aspect": "16:9" }'

{ "id": "8c1f…", "model": "flux-dev", "status": "IN_QUEUE", "credits": 4, "balance": 46 }

2 · Poll for the result

GET /api/generate/{id}. Poll every 1–2 s for images and every 5 s for video until status is COMPLETED or FAILED.

{ "status": "IN_QUEUE",    "position": 2 }
{ "status": "IN_PROGRESS", "logs": ["step 12/28"] }
{ "status": "COMPLETED",   "media": [{ "type": "image", "url": "https://…" }] }
{ "status": "FAILED",      "error": "The model rejected these settings.", "refunded": true }

Image to video (Seedance)

Upload the source image with POST /api/upload (multipart field file, JPEG/PNG/WebP up to 10 MB), then pass the returned URL with a resolution and duration. Seedance adds sound by default; send "audio": false for a silent clip (same price). Per-second models are charged ceil(credits_per_second × duration).

curl -X POST https://frameza.ai/api/upload -H "Authorization: Bearer $FRAMEZA_API_KEY" -F file=@still.jpg
{ "url": "https://v3.fal.media/files/…/still.jpg" }

curl -X POST https://frameza.ai/api/generate \
  -H "Authorization: Bearer $FRAMEZA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "seedance-2.5-flash", "imageUrl": "https://v3.fal.media/files/…/still.jpg",
        "prompt": "slow push-in, leaves drifting", "resolution": "720p", "duration": 5,
        "audio": true }'

{ "id": "…", "status": "IN_QUEUE", "credits": 227, "balance": 1673 }

Presenter clips (speech → talking avatar)

A presenter clip is two renders: turn a script into speech, then make a portrait speak that audio. Talking avatars and lip-sync are priced per second of the input audio (lip-sync: the longer of the video and the audio), so their audioUrl / videoUrl must be a file uploaded with POST /api/upload (we measure its length) or the output of one of your Frameza renders. Other URLs are rejected with 400.

# 1 · Script → speech  (15 credits per 1,000 characters)
curl -X POST https://frameza.ai/api/generate \
  -H "Authorization: Bearer $FRAMEZA_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "speech", "voice": "Calm_Woman",
        "text": "Hi, I am Maya. Here is what is new at Frameza this week…" }'
# poll GET /api/generate/{id} → { "status": "COMPLETED", "outputSeconds": 6.8,
#                                 "media": [{ "type": "audio", "url": "https://…/speech.mp3" }] }

# 2 · Portrait → upload  (or reuse any https image you uploaded before)
curl -X POST https://frameza.ai/api/upload -H "Authorization: Bearer $FRAMEZA_API_KEY" -F file=@maya.jpg
# → { "url": "https://v3.fal.media/files/…/maya.jpg", "kind": "image" }

# 3 · Portrait + speech → talking avatar  (~8.4 credits per second of audio)
curl -X POST https://frameza.ai/api/generate \
  -H "Authorization: Bearer $FRAMEZA_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "avatar", "imageUrl": "https://v3.fal.media/files/…/maya.jpg",
        "audioUrl": "https://…/speech.mp3", "prompt": "warm smile, natural gestures" }'
# → { "status": "IN_QUEUE", "inputSeconds": 6.8, "credits": 59 }

# Your own recording instead of step 1:
curl -X POST https://frameza.ai/api/upload -H "Authorization: Bearer $FRAMEZA_API_KEY" -F file=@voiceover.mp3
# → { "url": "https://…/voiceover.mp3", "kind": "audio", "seconds": 12.4 }

# Re-voice an existing video:
#   { "model": "lipsync", "videoUrl": "<uploaded or rendered video>", "audioUrl": "<uploaded or speech audio>" }

Models: avatar (Kling AI Avatar v2, best value), avatar-pro (Kling v2 Pro), avatar-hd (OmniHuman 1.5, 720p up to 60s or 1080p up to 30s), and lipsync. Uploads: audio up to 25 MB / 3 min, video up to 60 MB / 3 min.

JavaScript (server-side)

const API = "https://frameza.ai";
const headers = { Authorization: `Bearer ${process.env.FRAMEZA_API_KEY}` };

async function render(prompt, model = "flux-schnell") {
  const job = await fetch(`${API}/api/generate`, {
    method: "POST",
    headers: { ...headers, "Content-Type": "application/json" },
    body: JSON.stringify({ model, prompt }),
  }).then((r) => r.json());

  while (true) {
    await new Promise((r) => setTimeout(r, 1500));
    const s = await fetch(`${API}/api/generate/${job.id}`, { headers }).then((r) => r.json());
    if (s.status === "COMPLETED") return s.media;
    if (s.status === "FAILED") throw new Error(s.error);
  }
}

Models

idTypeOptionsPrice
flux-schnellimageaspect: 1:1 16:9 9:16 4:3 3:41 credits / run
flux-devimageaspect: 1:1 16:9 9:16 4:3 3:44 credits / run
flux-pro-ultraimageaspect: 1:1 16:9 9:16 4:3 3:49 credits / run
recraft-v3imageaspect: 1:1 16:9 9:16 4:3 3:46 credits / run
seedance-2.5-flashimage → videoimageUrl; resolution: 480p 720p; duration: 5 10 15 30; audio: true|false480p: 20.2 credits / sec720p: 45.4 credits / sec
seedance-2.5image → videoimageUrl; resolution: 480p 720p 1080p; duration: 5 10 15 30; audio: true|false480p: 33.1 credits / sec720p: 71 credits / sec1080p: 174.6 credits / sec
minimax-videovideoaspect: 16:975 credits / run
speechtext → speechtext (≤5,000 chars); voice: Wise_Woman Friendly_Person Calm_Woman Deep_Voice_Man Casual_Guy Lively_Girl Patient_Man Elegant_Man Inspirational_girl Determined_Man15 credits / 1,000 characters
avatartalking avatarimageUrl; audioUrl; max 60s8.4 credits / sec of audio
avatar-protalking avatarimageUrl; audioUrl; max 60s17.3 credits / sec of audio
avatar-hdtalking avatarimageUrl; audioUrl; resolution: 720p 1080p; max 60s @ 720p, 30s @ 1080p720p: 24 credits / sec of audio1080p: 24 credits / sec of audio
lipsynclip-syncvideoUrl; audioUrl; max 180s7.5 credits / sec of audio

Errors & limits