---
title: "Create generation"
method: POST
path: "/generations"
tags: ["generations"]
---

# Create generation

`POST /generations`

## Request

- Base URL: `https://www.socialfaktory.com/v1`
- URL: `https://www.socialfaktory.com/v1/generations`
- Auth: HTTP bearer

Run a video generation, spending credits already in the account. Quote it first with quote_generation and run only once the user agrees to the quote: the token monthly credit cap is the only other guard on the spend.

## Headers

- `Idempotency-Key` string, required

## Request body

- object
  - `workflow` object, required
    - `workflow_type` string
    - `brand_id` string
    - `video_type_id` string
    - `render_style` string
    - `render_style_id` string
    - `hook_id` string
    - `voice_id` string
    - `script` string
    - `spoken_script` string
    - `scene_brief` string
    - `type_description` string
    - `instruction` string
    - `negative_prompt` string
    - `caption_preset` string
    - `aspect_ratio` string
    - `reframe_aspect_ratio` string
    - `target_duration` integer
    - `target_language` string
    - `edit_kind` string
    - `product_kind` string
    - `tone` string
    - `actor_id` string
    - `actor_ids` string[]: The cast, lead first. A remake (video_swap or trend_remake) takes exactly one actor, who replaces the main person in the clip.
    - `user_product_id` string
    - `source_workflow_id` string
    - `source_url` string: The link the generation starts from: the web page a launch animation reads, or the video a trend remake, composed video or video swap copies. Either way, one the user made or has the rights to use.
    - `mode` 'template' | 'custom'
    - `brief` string
    - `asset_ids` string[]: Animated videos only: the library files the composition shows. Every other lane refuses them; a prompt_video takes files as references instead.
    - `prompt` string
    - `resolution` '480p' | '720p'
    - `sound` boolean
    - `references` object[]: The files a prompt_video works from, each called in the prompt as @ and its name: images, video clips (30 seconds in all, cut with trim [start, end] in seconds) and audio. Source upload takes the editor_asset id get_upload returns once the upload is ready, actor an actor id, product a product id, link the source_url of a video_reference upload, result a finished prompt_video generation id.
      - `kind` 'image' | 'video' | 'audio', required
      - `source` 'upload' | 'media' | 'link' | 'actor' | 'product' | 'result', required
      - `id` string, required
      - `name` string, required
      - `trim` number[]
    - `reference_url` string
    - `music` object
      - `kind` 'library' | 'upload' | 'none', required
      - `id` string
      - `asset_id` string
    - `start` number
    - `seconds` number
    - `keep_source_audio` boolean

## Response `201`

Create generation

- object
  - `generation_id` string, required
  - `status` string, required
  - `credit_cost` integer, required

## Other responses

- `default`: The error envelope

---

[API](https://skmtc.dev/socialfaktory/apis/socialfaktory-api.md) · [All operations](https://skmtc.dev/socialfaktory/apis/socialfaktory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/socialfaktory/apis/socialfaktory-api/revisions/aa1714ae1ba4?raw)
